Questions tagged [winrt-xaml]

This tag is for the XAML UI framework specific to Windows-Store-Apps on Windows-8. WinRT-XAML is a subset of the general XAML specification and a superset of Windows-Phone-8 XAML.

Filter by
Sorted by
Tagged with
0 votes
1 answer
81 views

WinUI3 CheckBox content style

I'm trying to change the color of a CheckBox text, but it doesn't work. Here is what I tried: <CheckBox x:Name="OptionCheckBox" Foreground="#FFFFFFF" Content=...
yonutix's user avatar
  • 2,124
0 votes
0 answers
47 views

XAML and ViewModel Binding inside ControlTemplate

I want to utilize the ViewModel function within the .xaml.cpp and .xaml file. I have created the ViewModel's getter and setter functions and attempted to bind it within the controlTemplate, where it ...
Anjali Kumari's user avatar
0 votes
1 answer
70 views

Changing the opacity of RichEditBox SelectionHighlightColor is not working in uwp?

changing the opacity of the RichEdibBox's SelectionHighlightColor is not working, this.editor.SelectionHighlightColor.Opacity = 0.1;
pavan kumar's user avatar
0 votes
0 answers
99 views

Adding a WinUI/WinRT Xaml form to a standard C++ library

I am developing a platform independent C++20 library (pure C++, no windows component) in VS2022, which among other things has a standardized error and message reporting subsystem. While the whole ...
Gaston's user avatar
  • 115
0 votes
2 answers
136 views

WinUI 3 How to make DataTemplate usable in all pages?

WinUI 3 c++/winrt. The DataTemplate is listed at the top of the page: <Page.Resources> <DataTemplate x:Key="SomeViewTemplate" x:DataType="local:SomeModel"> &...
breadman's user avatar
0 votes
2 answers
37 views

UWP "form" validation event

I have a StackPanel of basic input controls. Some combinations selections are invalid. I would like to recompute the "form"s validation every time one of the inputs change. Is there some ...
Tom Huntington's user avatar
0 votes
1 answer
17 views

Data binding through UserControl

Here's a minimal example of data binding. I would like know how to factor out both the ToggleSwitch and Button into different UserControls while keeping the data binding. //MainWindow.xaml <...
Tom Huntington's user avatar
0 votes
1 answer
57 views

in c++ winrt NavigationView how do I select an item after control is populated dynamically

I am using WinUi 2.8 and I have a navigation view that is populated dynamically using MenuItemsSource Property: <muxc:NavigationView x:Name="mainNav" MenuItemsSource="{x:Bind ...
Dorel Pîslan's user avatar
0 votes
1 answer
31 views

How to add label to Checkbox in Windows::UI::XAML::Controls

I am new to WINDOWS UI. Trying my hands with XAML based programming through C++. Here is the dummy piece of code that I am trying. Stackpanel st; CheckBox checkBox; checkBox.Name() = L""; st(...
Tausif's user avatar
  • 127
0 votes
1 answer
44 views

UWP C++WinRT How to disable a single item in a GridView

I have a <GridView/> with ItemsSource bind to IObservableVector<DeviceViewModel>. I want to disable only few of the items in this GridView. How can I do that? I saw other similar questions ...
rsp's user avatar
  • 559
0 votes
0 answers
75 views

x:DataType does not seem to accept my custom DataType

So I am currently trying to create a list view for a bunch of sounds. I made a new file and added a "SoundListItem" class, as the datatype in another file. I cannot get XAML to accept it at ...
Davide_24's user avatar
2 votes
1 answer
271 views

FileOpenPicker returns memory error in WinUI 3

With reference to my previous question I am exploring WinUI3 using C++ and struggling to find information and material on different community portals. I developed a demo app which has a window and 2 ...
Gaurang Dave's user avatar
  • 3,998
2 votes
1 answer
597 views

How to get Main Window Handle on Page in WinUI 3 Using C++

I am working on a WinUI 3 demo using C++. I want to get a Main or Native Window Handler to open a Picker within a Page. The code block which I am using works fine on Window but it does not work on ...
Gaurang Dave's user avatar
  • 3,998
0 votes
1 answer
423 views

How to navigate to a page in NavigationView in WinUI3 using C++

I am working on very simple demo of NavigationView in WinUI3 using C++. It is very unfortunate that there is no material or tutorial available for this. <Window x:Class="App1.MainWindow&...
Gaurang Dave's user avatar
  • 3,998
0 votes
1 answer
60 views

Any information about the default ScrollViewer for apps with DependencyObject as a parent?

MainWindow.xaml.cs using Microsoft.UI.Xaml; using Microsoft.UI.Xaml.Input; using System.Diagnostics; namespace TestApp3 { public sealed partial class MainWindow : Window { public ...
appletree5641's user avatar
0 votes
1 answer
85 views

How can I find namespace in xaml?

If you look at SettingsPage.xaml in a project created by TemplateStudio, you will find the following code: It doesn't work if I write the same code on the project I created without TemplateStudio. How ...
appletree5641's user avatar
0 votes
1 answer
78 views

How can I dynamically apply Lightweight styling to NavigationView?

Changing the NavigationViewContentMargin dynamically, which determines the top margin of the NavigationView, does not change the appearance of the NavigationView dynamically. Is there a way to ...
appletree5641's user avatar
0 votes
2 answers
249 views

WinUI3: Why does the top area of the NavigationView look different?

The default appearance of the NavigationView in WinUI3 Gallery or an app created with a template studio has a space at the top. However, it looks different in apps created with Visual Studio default ...
appletree5641's user avatar
0 votes
1 answer
78 views

A Microsoft.UI.Xaml.Markup.XamlParseException occurs when rendering many CheckBoxes

I'm working on WinUI3. An UnhandledException occurs when the code below is executed and CheckBoxes are rendered. public List<int> Collection { get; set; } public ViewModelConstructor() { ...
appletree5641's user avatar
-1 votes
1 answer
147 views

How can I make a layout that looks like what I want?

I am working on WinUI3 and the code below shows the image. <ScrollViewer HorizontalScrollBarVisibility="Auto"> <ItemsRepeater ItemsSource="{x:Bind ViewModel.Collection}&...
appletree5641's user avatar
1 vote
0 answers
91 views

UWP ListView - How to update BringIntoView to show part of next item, in both directions

I am working on a listview of items and I need to allow user to scroll up/down but I need the bring into view handling to bring the item into view as well as a small part of the next item (in ...
john-g's user avatar
  • 894
1 vote
1 answer
62 views

Why are these path segments misaligned?

I'm trying to create a circle constructed of several arcs using several XAML Path objects (declared in code). The problem is that upon drawing them, the paths end up misaligned, as shown in the ...
qanpi's user avatar
  • 33
0 votes
1 answer
136 views

Using {x: Bind} to bind to an XAML property, i.e. replacing {TemplateBinding XAMLProperty}

It is stated in MSDN that Starting with Windows 10, version 1809, you can use the x:Bind markup extension anywhere you use TemplateBinding in a ControlTemplate. However, when I try to replace ...
qanpi's user avatar
  • 33
1 vote
1 answer
257 views

How can I programatically set Path geometry using C++/WinRT + WinUI 3

After decades of writing MFC apps, I'm trying to learn C++/WinRT and WinUI 3. To do this, I'm working through Petzold's "Programming Windows" 6th edition, converting the code from C# to C++/...
dr_eck's user avatar
  • 59
-1 votes
1 answer
248 views

How to get the compositor instance while handling XamlCompositionBrushBase.OnConnected in a WinUI-3 desktop app

Following this c++ example i'm trying to create a custom brush in a WinUI 3 desktop application but i cannot find out how to get a compositor instance from within the OnConnected Method. The example ...
ridilculous's user avatar
1 vote
0 answers
119 views

"Edit a copy" option disabled in Visual Studio for custom control

I created a custom user control "controls:MyControl" using xaml and winrt/c++. This control is part of a nuget package. To test for further modification from user side, I added the package ...
LeJackArcher's user avatar
1 vote
0 answers
73 views

"Failed to end tracking the pointer, because it is not being tracked" exception in PointerPressed

I am getting the above mentioned exception in PointerPressed that too only in the case of MFC application hosted using XAML Islands. In normal UWP application it is working fine. Essentially no other ...
LeJackArcher's user avatar
1 vote
1 answer
476 views

How to get a control's handle in WinUI3 in C++?

I am working on a C++ WinUI3 project and got this problem. How do I obtain the handle of a XAML grid? Something like this in QT can achieve it: HWND m_hWnd; m_hWnd = (HWND)(ui.label->winId()); But ...
Clara2022's user avatar
-1 votes
1 answer
104 views

Converting an IInspectable to a RenderingEventArgs

How do you convert an IInspectable reference to a RenderingEventArgs in the following taken from the full xaml_app code below? CompositionTarget::Rendering(EventHandler::new(move |_, args: &Option&...
MRahilly's user avatar
1 vote
1 answer
100 views

Handle SwapChainPanel in ListView

I have my xaml code <ListView x:Name="ListVideo" ItemsSource="{x:Bind ScreenList}" VerticalAlignment="Stretch" FlowDirection=&...
Hoka Biu's user avatar
3 votes
0 answers
241 views

Get app HWND from UIElement section Xaml Island WinRT/C++

How to get the HWND part used for hosting the UIElement from a UWP project on a XamlIsland WinRT/C++ based application? The HWND I mean can be: Desktop application Window or other UI element (HWND) ...
Donny1605's user avatar
1 vote
0 answers
217 views

Access denied when initializing FileOpenPicker with HWND

I was following https://stackoverflow.com/a/57599016/8800839 to register the window to the filepicker, because I ran into the same problem. While doing so, I get an "Access Denied" error ...
JFFIGK's user avatar
  • 652
0 votes
1 answer
154 views

How to close ComboBox list items when moving application window of my WinRT/C++ UWP application?

I have a pair of ComboBox controls having IsEditable() true as well as false. When I am scrolling through my application or moving my application window (by clicking on the title bar) with list popup ...
LeJackArcher's user avatar
0 votes
2 answers
62 views

ContentPresenter's "Content" not centrally aligned vertically in UWP Controls

I am using a ToggleSwitch control to display 2 exclusive options in the application. Unfortunately, when FontSize increases the "Content" part seems to be not centrally aligned vertically. ...
LeJackArcher's user avatar
0 votes
1 answer
2k views

"LNK2019: unresolved external symbol" error resolution suggestions

Checked already asked questions but coudn't find a solution to this. I am trying to reproduce the example provided in https://learn.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Media.Animation....
LeJackArcher's user avatar
1 vote
1 answer
100 views

UWP: how to reflow controls based on grid width

I have two buttons placed horizontally. They are inside a grid. This grid containing two buttons has width 370. When the text on the button becomes large, it needs width more than 370. So what I want ...
rsp's user avatar
  • 559
1 vote
0 answers
175 views

UWP: How to subscribe to LayoutUpdated in C++WinRT

I am trying to subscribe to event LayoutUpdated in UWP C++WinRT app. I have following code code behind .h event_token layoutUpdatedToken{}; void MyLayoutUpdated(Windows::Foundation::IInspectable const&...
rsp's user avatar
  • 559
1 vote
1 answer
107 views

Is it possible to change the color of the highlighted text in UWP XAML?

By setting a "SelectionHighlightColor" we can set the color of highlight but I wish to change the font color of text which is being highlighted. Is there any workaround to achieve this, as I ...
LeJackArcher's user avatar
1 vote
1 answer
120 views

What is the equivalent of .Net Double.PositiveInfinity in C++WinRT?

If at all there is. And if not, what should be passed to functions like var tb = new TextBlock { Text = "Text", FontSize = 10 }; tb.Measure(new Size(Double.PositiveInfinity, Double....
rsp's user avatar
  • 559
0 votes
0 answers
60 views

UWP: Lifecycle event when the content on elements becomes available when content is set using async

I have UWP page and it is using data binding to set content on xaml elements (texts, buttons, image). I am setting the content using async calls (getting content from internet). In the page's c'tor, I ...
rsp's user avatar
  • 559
0 votes
1 answer
182 views

How to avoid text on a button from being cut off in UWP xaml

I have a button with MinWidth set as MinWidth="118" and that works fine. But when I change the Text size in windows using Settings -> Accessibility -> Text Size -> change it to 200%,...
rsp's user avatar
  • 559
0 votes
1 answer
56 views

Why I am getting C3646 on an IAsyncAction declaration?

Probably a dumb question (WinRT noob), but, here is goes... The code from "App.xaml.h" is: namespace winrt::Precog::implementation { struct App : AppT<App> { App(); ...
Renato Prado's user avatar
0 votes
1 answer
74 views

In my UWP application ComboBox, PointerExited event fired right after we click on the control when IsEditable is False

There seems to be a similar question but it is not resolved. I am using a ComboBox in my WinRT/C++ application and need to show the cursor as Hand while hovering over it. The issue is that while ...
LeJackArcher's user avatar
0 votes
0 answers
696 views

Cannot compile WinUI 3.0 app that references a custom Windows Runtime component

I have a Visual Studio 2019 solution that contains two project. The first project has been created using the "Windows Runtime Component (WinUI 3) Visual Studio template (library project). It ...
ackh's user avatar
  • 1,760
1 vote
1 answer
225 views

x:Bind to ActualWidth does not appear to work

I'm programming C# UWP. I have a UserControl with the following sample code: <UserControl x:Class="Sample.AllocPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/...
Arush Agarampur's user avatar
0 votes
0 answers
287 views

Visual Studio C++/WinRT Core App vs Blank App

If you are aiming to write a multi-threaded application with some intensive non-graphics background threads as well as a Direct3D based presentation layer which of the two Visual Studio templates Core ...
TJA's user avatar
  • 2,999
2 votes
1 answer
82 views

Crash when using HyperlinkButton with empty NavigateUri

I am trying to use HyperlinkButton in my uwp app. And I am setting “NavigateUri” later in the lifecycle of the control. Default value of “ViewModel.SecondaryLink” in the below code snippet is empty. ...
rsp's user avatar
  • 559
0 votes
1 answer
1k views

How to convert winrt::hstring to int in C++ Winui application?

I have used the template called Blank App, Package (Winui 3 in desktop) inside Visual Studio. I want to make a really simple function which add 2 value together. This is what the application looks ...
Hon Wi Cong's user avatar
1 vote
0 answers
403 views

error : Project "" does not contain any configuration

I have created a simple static library using Blank app template from this extension https://marketplace.visualstudio.com/items?itemName=CppWinRTTeam.cppwinrt101804264 I have customized the project a ...
rsp's user avatar
  • 559
0 votes
0 answers
174 views

Can I debug UWP winrt libraries? Does Microsoft provide symbol files for those libraries?

I am running into problems while developing a UWP app. So I was wondering if Windows provides symbol files for winrt components. Particularly I am looking to step into the function ...
rsp's user avatar
  • 559

1
2 3 4 5
80