wpfui
wpfui copied to clipboard
The buttons located at window's title bar can not be hit
Describe the bug
I'd like to implement a window like Edge or Chrome that retains all the native interactions, and the TabControl extends to the top of the window's title bar.
xmal as below:
<ui:FluentWindow
x:Class="WpfChromeApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
Title="MainWindow"
Width="800"
Height="450"
ExtendsContentIntoTitleBar="True"
WindowChrome.IsHitTestVisibleInChrome="True"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition x:Name="SecondRow" Height="*" />
</Grid.RowDefinitions>
<StackPanel
Grid.Row="0"
HorizontalAlignment="Right"
Orientation="Horizontal">
<ui:Button Content="Min" Icon="{ui:SymbolIcon Fluent24}" />
<ui:Button Content="Close" Icon="{ui:SymbolIcon Fluent24}" />
</StackPanel>
<TabControl
Grid.RowSpan="2"
Margin="20,0,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<TabItem Header="111">
<TabItem.Content>
<Grid>
<ui:Card Margin="8">
<ui:Button Content="Hello World" Icon="{ui:SymbolIcon Fluent24}" />
</ui:Card>
</Grid>
</TabItem.Content>
</TabItem>
<TabItem Header="222" />
</TabControl>
</Grid>
</ui:FluentWindow>
This window showed well. However,I can not raise the click event of the Min button and Close button.
To Reproduce
Refer to description: run the codes
Expected behavior
<ui:Button Content="Min" Icon="{ui:SymbolIcon Fluent24}" /> <ui:Button Content="Close" Icon="{ui:SymbolIcon Fluent24}" />
These two buttons could be clicked.
Screenshots
OS version
windows 11
.NET version
.NET 8
WPF-UI NuGet version
3.0.3
Additional context
No response
@NeverMorewd This is because your tab control overlays the buttons. First add the tab control and then the StackPanel with the buttons.
@NeverMorewd Does that solve your problem? If yes, please close this issue.
@NeverMorewd Does that solve your problem? If yes, please close this issue.
Yes. Thanks for you reminder