Skip to content

Commit 336efde

Browse files
authored
Merge pull request #1049 from zui-jiu-zhou/develop
IsDisplayOptionsButtonVisible property is added to RibbonTabControl
2 parents 6a7ca90 + 1fab06d commit 336efde

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

Fluent.Ribbon/Controls/RibbonTabControl.cs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,18 @@ public bool IsMouseWheelScrollingEnabled
393393
get { return (bool)this.GetValue(IsMouseWheelScrollingEnabledProperty); }
394394
set { this.SetValue(IsMouseWheelScrollingEnabledProperty, BooleanBoxes.Box(value)); }
395395
}
396+
397+
/// <summary>Identifies the <see cref="IsDisplayOptionsButtonVisible"/> dependency property.</summary>
398+
public static readonly DependencyProperty IsDisplayOptionsButtonVisibleProperty = DependencyProperty.Register(nameof(IsDisplayOptionsButtonVisible), typeof(bool), typeof(RibbonTabControl), new PropertyMetadata(BooleanBoxes.TrueBox));
399+
400+
/// <summary>
401+
/// Defines whether display options button is visible or not.
402+
/// </summary>
403+
public bool IsDisplayOptionsButtonVisible
404+
{
405+
get { return (bool)this.GetValue(IsDisplayOptionsButtonVisibleProperty); }
406+
set { this.SetValue(IsDisplayOptionsButtonVisibleProperty, BooleanBoxes.Box(value)); }
407+
}
396408

397409
#endregion
398410

@@ -1052,4 +1064,4 @@ protected override IEnumerator LogicalChildren
10521064
}
10531065
}
10541066
}
1055-
}
1067+
}

Fluent.Ribbon/Themes/Controls/RibbonTabControl.xaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,8 @@
327327
Icon="{DynamicResource Fluent.Ribbon.Images.RibbonDisplayOptions}"
328328
Size="Small"
329329
Style="{DynamicResource Fluent.Ribbon.Styles.RibbonTabControl.DisplayOptionsButton}"
330-
ToolTip="{DynamicResource Fluent.Ribbon.ScreenTips.Resources.RibbonTabControl.DisplayOptionsScreenTip}">
330+
ToolTip="{DynamicResource Fluent.Ribbon.ScreenTips.Resources.RibbonTabControl.DisplayOptionsScreenTip}"
331+
Visibility="{Binding IsDisplayOptionsButtonVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource Fluent.Ribbon.Converters.BoolToVisibilityConverter}}">
331332
<Fluent:MenuItem Header="{Binding Source={x:Static Fluent:RibbonLocalization.Current}, Path=Localization.ShowRibbon, Mode=OneWay}"
332333
FontWeight="Bold"
333334
Foreground="{DynamicResource Fluent.Ribbon.Brushes.Black}"
@@ -421,4 +422,4 @@
421422
</MultiTrigger>
422423
</ControlTemplate.Triggers>
423424
</ControlTemplate>
424-
</ResourceDictionary>
425+
</ResourceDictionary>

0 commit comments

Comments
 (0)