Skip to content

Commit c29003c

Browse files
committed
WPF-998696-Documentation for BackStageHeaderTemplate support in Ribbon
1 parent 29a1890 commit c29003c

File tree

2 files changed

+67
-0
lines changed

2 files changed

+67
-0
lines changed

wpf/Ribbon/Backstage.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,3 +2406,70 @@ private void MainWindow_Loaded(object sender, RoutedEventArgs e)
24062406

24072407
![WPF Ribbon BackStageButton collapsed by using Visibility property](GettingStarted_images/wpf-ribbon-backstagebutton-visibility.png)
24082408

2409+
## Customizie the Backstage Header
2410+
2411+
You can customize the `BackstageButton` header in Ribbon by using the `BackStageHeaderTemplate` property. This property accepts a DataTemplate to define the header layout, such as adding an icon and text.
2412+
2413+
The following code example illustrates how to customize the BackstageButton header.
2414+
2415+
{% tabs %}
2416+
2417+
{% highlight XAML %}
2418+
2419+
<syncfusion:RibbonWindow x:Class="IconSupport_BackStageButton.MainWindow"
2420+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
2421+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
2422+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
2423+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
2424+
xmlns:local="clr-namespace:IconSupport_BackStageButton"
2425+
mc:Ignorable="d"
2426+
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
2427+
syncfusion:SfSkinManager.VisualStyle="Windows11Light"
2428+
Title="MainWindow" Height="450" Width="800"
2429+
WindowStartupLocation="CenterScreen">
2430+
<syncfusion:RibbonWindow.Resources>
2431+
<DataTemplate x:Key="FileHeaderTemplate">
2432+
<StackPanel Orientation="Horizontal">
2433+
<Image Width="16" Height="16" Source="\Image\10782771.png"/>
2434+
<TextBlock Text="File" FontWeight="Bold"/>
2435+
</StackPanel>
2436+
</DataTemplate>
2437+
</syncfusion:RibbonWindow.Resources>
2438+
<Grid>
2439+
<syncfusion:Ribbon x:Name="_ribbon" VerticalAlignment="Top" BackStageHeaderTemplate="{StaticResource FileHeaderTemplate}">
2440+
<syncfusion:RibbonTab Caption="HOME" IsChecked="True">
2441+
<syncfusion:RibbonBar Name="New" Width="120" Header="New">
2442+
<syncfusion:RibbonButton SizeForm="Large" Label="New Email"/>
2443+
<syncfusion:DropDownButton SizeForm="Large" Label="New Items">
2444+
<syncfusion:DropDownMenuItem Header="E-mail Message"/>
2445+
<syncfusion:DropDownMenuItem Header="Appointment"/>
2446+
<syncfusion:DropDownMenuItem Header="Meeting"/>
2447+
<syncfusion:DropDownMenuItem Header="Contact"/>
2448+
<syncfusion:DropDownMenuItem Header="Task"/>
2449+
</syncfusion:DropDownButton>
2450+
</syncfusion:RibbonBar>
2451+
<syncfusion:RibbonBar Name="Delete" Width="130" Header="Delete">
2452+
<syncfusion:RibbonButton Label="Ignore"/>
2453+
<syncfusion:RibbonButton Label="Delete" SizeForm="Large"/>
2454+
</syncfusion:RibbonBar>
2455+
<syncfusion:RibbonBar Name="Respond" Width="200" Header="Respond">
2456+
<syncfusion:RibbonButton Label="Reply" SizeForm="Large"/>
2457+
<syncfusion:RibbonButton Label="Reply All" SizeForm="Large"/>
2458+
<syncfusion:RibbonButton Label="Forward" SizeForm="Large"/>
2459+
<syncfusion:RibbonButton Label="Meeting"/>
2460+
</syncfusion:RibbonBar>
2461+
<syncfusion:RibbonBar Name="Quicksteps" Width="90" Header="Quick Steps"/>
2462+
<syncfusion:RibbonBar Name="Find" Width="90" Header="Find"/>
2463+
</syncfusion:RibbonTab>
2464+
<syncfusion:RibbonTab Caption="SEND/RCEIVE" IsChecked="False"/>
2465+
<syncfusion:RibbonTab Caption="FOLDER" IsChecked="False"/>
2466+
<syncfusion:RibbonTab Caption="VIEW" IsChecked="False"/>
2467+
</syncfusion:Ribbon>
2468+
</Grid>
2469+
</syncfusion:RibbonWindow>
2470+
2471+
{% endhighlight %}
2472+
2473+
{% endtabs %}
2474+
2475+
![WPF Ribbon BackStageButton header template support by using BackStageHeaderTemplate property](GettingStarted_images/wpf-ribbon-backstagebutton-template.png)
17.5 KB
Loading

0 commit comments

Comments
 (0)