1,847 questions
33
votes
1
answer
27k
views
Is WPF getting outdated with arrival of WinUI-3? [closed]
Is WPF getting outdated with arrival of WinUI-3?
When it comes to Desktop Application development,
Is it about time to migrate to WinUI-3 completely leaving behind WinForm/WPF legacy ??
26
votes
3
answers
17k
views
Where is WinUI3 in Visual Studio 2022?
I am unable to find Microsoft's new development platform WinUI3 in visual studio. Should I install any components or something bug in my VS?
19
votes
1
answer
14k
views
For Dotnet Maui, what the difference between Application.Current?.Dispatcher.Dispatch(async()) and MainThread.InvokeOnMainThreadAsync
Title says it all, docs don't seem to say which should be preferred. They have the same arguments you can pass basically too.
https://learn.microsoft.com/en-us/dotnet/api/microsoft.maui....
18
votes
1
answer
12k
views
Where is the designer view in WinUI 3?
I was developing uwp apps for the past few years, now moving to winui3. It is my first project. I am unable to find the designer view for the XAML files. Is it not available in WinUI3? or something ...
14
votes
6
answers
10k
views
WINUI 3.0 - Reunion 0.5 window size///
I just start learning WinUI 3.0 and can't find any information in google or books like Learn WinUI 3.0 how to set default window size of application. I know in UWP it can be like
ApplicationView....
12
votes
2
answers
10k
views
How do I deploy a WinUI 3 desktop application in a managed environment? Has anyone done it successfully?
I cannot figure this out. I just want to publish/deploy a hello world simple WinUI 3 app. Before I publish my real app (I tried to publish my full app, but I thought maybe there was something wrong ...
11
votes
3
answers
10k
views
How to retrieve the window handle of the current WinUI 3 MainWindow from a page in a frame in a NavigationView control on the MainWindow
I am creating my first WinUI 3 desktop application. I have a NavigationView on my MainWindow.
I have 9 different pages that I navigate to via the frame in the NavigationView.
One of the pages is for ...
11
votes
4
answers
6k
views
How do I access Window Resources in WinUI 3
I've just started working on a WinUi 3 (Desktop) project and have got blocked trying to add Window resources to a Window.
I would have thought the following would work. However there appears to be no ...
10
votes
5
answers
7k
views
TrayIcon with WinUI 3
I am trying to make a program that runs in the background, and I want to place a Tray Icon in the Tray Icon Section of Windows.
I didn't find a solution to do this without using Windows Forms (which ...
9
votes
2
answers
10k
views
Can I use VSCode for developing WINDOW DESKTOP Apps using WinUI 3 or MAUI or UNO stack?
I am trying to set up a project in VSCode to build & run windows desktop apps: WinUI / MAUI / UNO because our team is mostly using VSCode.
I am aware that Visual Studio 2022 is recommended for ...
8
votes
5
answers
4k
views
How to open WinUI Maui through URI Activation?
I've created a Maui windows application. I'm looking to activate the application through a URI and pass query parameters to the app.
I've added the windows protocol for calling the app via uri in the ...
8
votes
2
answers
2k
views
How to create WinUI3 GUI in PowerShell?
The Goal
Creating and rendering a simple WinUI3 GUI in PowerShell 7.5 which is based on .NET 9. Nothing complicated, just a window and a button in it, such as this XAML
<?xml version="1.0"...
7
votes
1
answer
4k
views
WinUI XAML: Using a ResourceDictionary from another project
In my WinUI 3 application, I am trying to use a ResourceDictionary that is located in another project.
Lets say the referenced project is ResourceTestLib and this library project has a folder "...
7
votes
3
answers
3k
views
Is it possible to configure an observable property that has a private setter using the community toolkit?
i am using CommunityToolkit to configure the binding properties in the view model, but in some cases I would like to set the property only as readonly. So I am tryiung this:
[ObservableProperty]
...
6
votes
6
answers
6k
views
How to Maximize, Minimize, Restore WinUI window from code
I'm creating a demo app using WinUI 3 prerelease 0.5 (project reunion).
I would like to maximize, minimize, and restore the window state from c# managed code. Are there any examples available?
6
votes
1
answer
9k
views
In WinUI 3, is there a way to dynamically set a Window's size and position?
In .NET WinUI 3 (Microsoft.UI.Xaml.* in Windows 11), I am looking for a way to dynamically set my main Window's initial size and position.
Ideally, I would like to:
Detect which of the 1..* monitors ...
6
votes
1
answer
4k
views
Content Dialog not showing up WINUI3
I'm trying to show a popup to edit a brand in my app but it doesn't show up.
Function where I call the Dialog:
private async Task EditBrandAsync(Brand brand)
{
var dialog = new ContentDialogs....
6
votes
3
answers
3k
views
How to set the minimum size of a window?
So in UWP, we can use
ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(500, 500));
but
ApplicationView.GetForCurrentView();
returns null in WinUI 3.
Is there a way to set the minimum ...
6
votes
2
answers
4k
views
Do WinUI applications need runFullTrust to publish to the Windows Store?
I recently took a stock WinUI template, added my old UWP C# code, recompiled and tried to publish. The Windows Store Application Submission warns me that I shouldn't use the runFullTrust setting:
We ...
6
votes
0
answers
1k
views
.NET6 Win UI Microsoft.DesktopBridge.props not found when using dotnet cli
I am creating a .NET6 WinUI application which works and runs fine when built and executed via Visual Studio 2022.
If I try to build via the cli (dotnet build) I get an error that Microsoft....
5
votes
3
answers
11k
views
C# CommunityToolkit.Mvvm ObservableProperty on a list
I want to try the Community Toolkit 8.0 the MVVM part.
I have a very simple application:
....
d:DataContext="{d:DesignInstance Type=local:MainWindowViewModel}"
....
<Grid>
...
5
votes
3
answers
3k
views
WinUI 3 - custom control with content
I can't find how to easily create a custom control in which I can insert content in xaml. For example, I would like my control to contain a grid that I style somehow and then insert content into it ...
5
votes
2
answers
1k
views
Where can I find a list of all standard theme brushes when writing XAML?
Where can I find a visual list of all the standard theme brushes available to me in UWP/WinUI3 XAML?
For example, the High Contrast themes documentation includes a visual list of all the colors, ...
5
votes
4
answers
3k
views
Is it possible to publish an unpackaged Windows App SDK (WinUI 3) as self contained single file?
I'm pretty sure I have all the right flags and everything set according to Microsoft Docs, however the UI dlls are not being included in the single file exe.
5
votes
2
answers
642
views
MSTest v2 won't run with net5.0-windows
I am trying to create a MSTest project for unit testing of our WinUI 3 development. I am able to run tests through the test explorer when targeting .NET 5.0.
Project Reunion requires net5.0-windows10....