[WinUI 3] Custom TitleBar Window Decorations not working
See original GitHub issueI have enabled ExtendsContentIntoTitleBar = true;
and created a custom title bar as follows:
<Grid Name="TitleBar" HorizontalAlignment="Stretch" VerticalAlignment="Top" Height="30" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="LeftPaddingColumn" Width="0"/>
<ColumnDefinition/>
<ColumnDefinition x:Name="RightPaddingColumn" Width="0"/>
</Grid.ColumnDefinitions>
<TextBlock Grid.Column="1" Margin="20,8,0,0" Style="{StaticResource CaptionTextBlockStyle}" Text="{x:Bind ViewModel.Title}"/>
</Grid>
I also set this title bar with SetTitleBar(TitleBar);
This is the result:
As you can see, the window decorations (Minimize, Maximize, Close) are not the correct size as they are on every other Windows window and these buttons also don’t work (they seem to be disabled and don’t do anything when clicked). How can I get them to 1. be the correct size and 2. function correctly?
Btw, using the Windows App SDK V0.8.1 with WinUI 3
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Custom title bar not working in Unpackaged mode of ...
Hi, I have created Winui3vApp with custom title bar by using ... Custom title bar not working in Unpackaged mode of Winui3 in...
Read more >How do I customize the Window Titlebar in a Windows App ...
I use the OverlapsedPresenter class to change some things about the window, like if it's resizable or not. Share.
Read more >Why is it so incredibly complicated to make a custom title ...
Custom title bars are a good way to make sure anyone using your app is miserable because if you make one small mistake,...
Read more >Winui Titlebar
Custom title bar not working in Unpackaged mode of Winui3 in. winui 3 title bar. ... There is no obvious way to control...
Read more >3 apps, same PC - different title bar colours and highlights
The only way to change the title bar seems to be to change the theme to ... Certain Windows apps will not reflect...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@hayashida-katsutoshi Works perfectly. Thank you very much
I use this for the title bar and the Minimize/Maximize/Close are working on a Windows 10 PC. I tested it in WinUI3 unpackaged desktop with Windows App SDK 1.0.
You can add an icon inserting an Image tag before the TextBlock. The icon will have no context menu but fair enough to me.