158 questions
4
votes
1
answer
3k
views
Where is the generic.xaml file located?
If you want to use the default styles, colors, etc..., you need to bring them from the generic.xaml file that comes with WindowsAppSDK NuGet packages.
Hence the question, where is located the generic....
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 ...
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 ...
27
votes
8
answers
38k
views
MAUI how to remove the Title Bar and fix the window size?
How can I remove the Title Bar in MAUI and fix the window size as 800x400 pixels in the Windows version of the application?
full size
I searched for a very long time in the Internet, but I found ...
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 ...
4
votes
2
answers
4k
views
Can't use WinUI 3 File Picker
I'm trying to show a file picker in my Windows App SDK (WinUI 3) application. I'm making it in C#.
Here's my function to show the file picker:
private async Task<StorageFile> PickFileAsync()
{
...
14
votes
6
answers
10k
views
"The project doesn't know how to run the profile MauiApp.WinUI"
I am trying to get started with a brand new .NET Maui application. Upon creating the project, it has a single project for the MauiApp, and another project named MauiApp.WinUI. When I try to run the ...
8
votes
1
answer
3k
views
Can I use existing WinUI3 controls in MAUI project?
Is it possible to use the exisiting controls of WinUI 3 in the MAUI project? Like controls in https://github.com/microsoft/WinUI-Gallery
I installed the WinUI package to my MAUI project
<ItemGroup&...
4
votes
1
answer
3k
views
How do I change the default font of my WinUI application?
I couldn't find any guidance on Microsoft websites or on the winui github. I'm working on a WinUI 3 application, and have previously worked on WPF. I tried setting a default FontFamily for my ...
3
votes
1
answer
644
views
Convert System.Drawing.Icon to Microsoft.UI.Xaml.ImageSource
Resolutions exist to convert System.Drawing.Icon to System.Media.ImageSource (see Convert System.Drawing.Icon to System.Media.ImageSource). But when I used WinUI instead of WPF, this resolution seems ...
2
votes
2
answers
4k
views
How do I open a new Window in WinUI3 with WinRT/C++?
How do I open a new window in WinRT / WinUI3? I want to click a button and open up another floating window on top of the current / main window.
I have tried code from several samples with zero luck:
...
2
votes
1
answer
939
views
WebView2 in Winui 3: CORS errors when loading an Ionic/Angular application from the local file system
Following on from my last post, am looking for a way to wrap my Ionic/Angular application with some sort of Windows application. I am looking at Electron (and having issues), but also investigating if ...
2
votes
1
answer
2k
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 ...
2
votes
1
answer
572
views
How to make a global keyboard accelerator/hotkey for a button?
I have a ToggleButton with a KeyboardAccelerator that toggles a button whenever the B key is pressed. The problem I am having is that button is only togglable using the keyboard accelerator when the ...
1
vote
1
answer
821
views
How do I solve this System.InvalidCastException in WinUI3 while trying to get the window handler?
I am developing an application in WinUI 3 and I need to open a folder picker dialog. To do so I visited the documentation and GitHub pages and this is what I wrote (PrincipalPage.xaml.cs):
(...)
...
1
vote
3
answers
332
views
Template Studio application - Adding a Login Window to be called before the Main Window is displayed
I am building a WinUI 3 Application. I have used the Template Studio to Create a number of pages. Now I am trying to add a log in Window to be called before the main Window.
The Login Screen is of ...
0
votes
1
answer
263
views
Contentdialog on startup
I am a total beginner with WinUI, but have some experience with C# and Windows Forms.
I am trying out WinUI 3 for the first time and am trying to open a login window (ContentDialog) before the ...
0
votes
1
answer
1k
views
WinUI3 C++ Data Binding
In reference to my question about TreeView, I was suggested to use data binding to populate the items of the TreView.
I create a new Black App, Packaged, WinUI3 in Desktop C++ VS 2022 project.
This ...
0
votes
1
answer
493
views
WinUI3: Exception thrown while trying to create a FilePicker
I copied the example code from WinUI3 Gallery, it works perfect in MainWindow, but when I do the same thing in a subpage, I received an Exception.
I know the problem is with getting the window handle,...
0
votes
2
answers
2k
views
WinUI3: display dialog at startup from main window?
I'm getting started with WinUI3. Having no previous experience with UWP or WPF or even much C#, it's tough going.
Today's question is how to display a simple dialog at startup. Consider that we start ...
14
votes
2
answers
8k
views
Difference between Windows App SDK and WinUI 3
I develop many UWP apps to Windows 10, but to Windows 11 I have so many questions and sometimes the Microsoft Docs it's confusing. I want develop new apps to Windows 11 but I am totally lost!
What is ...
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"...
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 ...
5
votes
2
answers
588
views
How to combine [JsonPropertyName] and [ObservableProperty] on the same member?
I'm trying to combine [JsonPropertyName] with [ObservableProperty] to assign the value "last_updated" of my json to the property "Updated" of my object.
I tried this code:
[...
4
votes
1
answer
9k
views
How to add style for Title of ContentPage in .Net MAUI?
I'm working with .NET MAUI to create a desktop app.
Here, I have a ContentPage with the title My title.
<ContentPage
x:Class="MAUI.Desktop.Pages.PlanningPage"
xmlns="http://...