Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion WinUIGallery/ControlPages/TitleBarPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,14 @@
</StackPanel>
</StackPanel>
</local:ControlExample.Example>

<local:ControlExample.Xaml>
<x:String xml:space="preserve">
&lt;!--UIElement set as titlebar--&gt;
&lt;Border x:Name="AppTitleBar" Grid.Column="1" VerticalAlignment="Top"&gt;
&lt;TextBlock x:Name="AppTitle" Text="{StaticResource AppTitleName}" VerticalAlignment="Top" Margin="0,8,0,0" /&gt;
&lt;/Border&gt;
</x:String>
</local:ControlExample.Xaml>
</local:ControlExample>
<local:ControlExample HeaderText="Titlebar Customizations : Interactive controls in Titlebar (non client) area"
CSharpSource="Window\TitleBar\TitleBarSample3.txt">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
// UIElement set as titlebar
<Border x:Name="AppTitleBar" Grid.Column="1" VerticalAlignment="Top">
<TextBlock x:Name="AppTitle" Text="{StaticResource AppTitleName}" VerticalAlignment="Top" Margin="0,8,0,0" />
</Border>

// C# code to set AppTitleBar uielement as titlebar
// C# code to set AppTitleBar uielement as titlebar
Window window = App.MainWindow;
window.ExtendsContentIntoTitleBar = true; // enable custom titlebar
window.SetTitleBar(AppTitleBar); // set user ui element as titlebar