Skip to content

Commit 124954b

Browse files
committed
Fixes #936 by changing panel in BackstageTabControl to DockPanel
1 parent 7a847a4 commit 124954b

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

Changelog.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
- ### Enhancements/Features
2525
- [#935](../../issues/935) - Support MediumIcon (24x24) size in RibbonGroupBox (thanks @nishy2000)
26+
- [#936](../../issues/936) - Add ability to vertically align items in Backstage
2627
- Added automation peers for `InRibbonGallery` and `GalleryItem`
2728
- Improved keyboard navigation for `InRibbonGallery`
2829

Fluent.Ribbon.Showcase/TestContent.xaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,8 @@ Pellentesque nec dolor sed lacus tristique rutrum sed vitae urna. Sed eu pharetr
293293
<Fluent:Button Header="Exit"
294294
Icon="{iconPacks:Material Kind=ExitToApp}"
295295
KeyTip="X"
296-
Command="{Binding ExitCommand}" />
296+
Command="{Binding ExitCommand}"
297+
VerticalAlignment="Bottom" />
297298
</Fluent:BackstageTabControl>
298299
</Fluent:Backstage>
299300

Fluent.Ribbon/Themes/Controls/BackstageTabControl.xaml

+14-1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
Value="{DynamicResource Fluent.Ribbon.Brushes.IdealForegroundColorBrush}" />
8484
<Setter Property="Fluent:RibbonProperties.IconSize"
8585
Value="Small" />
86+
<Setter Property="DockPanel.Dock"
87+
Value="Top" />
8688
</Style>
8789

8890
<ControlTemplate x:Key="BackstageBackButtonTemplate"
@@ -159,6 +161,8 @@
159161
Value="{DynamicResource Fluent.Ribbon.Brushes.Backstage.BackButton.Background}" />
160162
<Setter Property="Foreground"
161163
Value="{DynamicResource Fluent.Ribbon.Brushes.Backstage.BackButton.Foreground}" />
164+
<Setter Property="DockPanel.Dock"
165+
Value="Top" />
162166
</Style>
163167

164168
<Style TargetType="{x:Type Fluent:SeparatorTabItem}"
@@ -167,6 +171,8 @@
167171
Value="25,10,20,10" />
168172
<Setter Property="Focusable"
169173
Value="False" />
174+
<Setter Property="DockPanel.Dock"
175+
Value="Top" />
170176
<Setter Property="Template">
171177
<Setter.Value>
172178
<ControlTemplate TargetType="{x:Type Fluent:SeparatorTabItem}">
@@ -235,7 +241,7 @@
235241
KeyboardNavigation.DirectionalNavigation="Cycle">
236242
<Grid.RowDefinitions>
237243
<RowDefinition Height="Auto" />
238-
<RowDefinition Height="Auto" />
244+
<RowDefinition Height="*" />
239245
</Grid.RowDefinitions>
240246
<Fluent:WindowSteeringHelperControl Grid.RowSpan="2"
241247
Height="{Binding SelectedContentMargin.Top, RelativeSource={RelativeSource TemplatedParent}}"
@@ -296,6 +302,13 @@
296302
Value="{DynamicResource Fluent.Ribbon.Brushes.BackstageTabControl.ItemsPanelBackground}" />
297303
<Setter Property="ItemContainerStyleSelector"
298304
Value="{x:Static styleSelectors:BackstageTabControlItemContainerStyleSelector.Instance}" />
305+
<Setter Property="ItemsPanel">
306+
<Setter.Value>
307+
<ItemsPanelTemplate>
308+
<DockPanel />
309+
</ItemsPanelTemplate>
310+
</Setter.Value>
311+
</Setter>
299312
<Setter Property="SelectedContentMargin">
300313
<Setter.Value>
301314
<MultiBinding Converter="{x:Static converters:StaticConverters.ThicknessConverter}">

Fluent.Ribbon/Themes/Controls/BackstageTabItem.xaml

+2
Original file line numberDiff line numberDiff line change
@@ -91,5 +91,7 @@
9191
Value="{DynamicResource Fluent.Ribbon.Brushes.BackstageTabItem.Selected.Background}" />
9292
<Setter Property="Margin"
9393
Value="0" />
94+
<Setter Property="DockPanel.Dock"
95+
Value="Top" />
9496
</Style>
9597
</ResourceDictionary>

0 commit comments

Comments
 (0)