Skip to content

Commit

Permalink
Merge pull request #1049 from zui-jiu-zhou/develop
Browse files Browse the repository at this point in the history
 IsDisplayOptionsButtonVisible property is added to RibbonTabControl
  • Loading branch information
batzen authored Aug 9, 2022
2 parents 6a7ca90 + 1fab06d commit 336efde
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
14 changes: 13 additions & 1 deletion Fluent.Ribbon/Controls/RibbonTabControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,18 @@ public bool IsMouseWheelScrollingEnabled
get { return (bool)this.GetValue(IsMouseWheelScrollingEnabledProperty); }
set { this.SetValue(IsMouseWheelScrollingEnabledProperty, BooleanBoxes.Box(value)); }
}

/// <summary>Identifies the <see cref="IsDisplayOptionsButtonVisible"/> dependency property.</summary>
public static readonly DependencyProperty IsDisplayOptionsButtonVisibleProperty = DependencyProperty.Register(nameof(IsDisplayOptionsButtonVisible), typeof(bool), typeof(RibbonTabControl), new PropertyMetadata(BooleanBoxes.TrueBox));

/// <summary>
/// Defines whether display options button is visible or not.
/// </summary>
public bool IsDisplayOptionsButtonVisible
{
get { return (bool)this.GetValue(IsDisplayOptionsButtonVisibleProperty); }
set { this.SetValue(IsDisplayOptionsButtonVisibleProperty, BooleanBoxes.Box(value)); }
}

#endregion

Expand Down Expand Up @@ -1052,4 +1064,4 @@ protected override IEnumerator LogicalChildren
}
}
}
}
}
5 changes: 3 additions & 2 deletions Fluent.Ribbon/Themes/Controls/RibbonTabControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,8 @@
Icon="{DynamicResource Fluent.Ribbon.Images.RibbonDisplayOptions}"
Size="Small"
Style="{DynamicResource Fluent.Ribbon.Styles.RibbonTabControl.DisplayOptionsButton}"
ToolTip="{DynamicResource Fluent.Ribbon.ScreenTips.Resources.RibbonTabControl.DisplayOptionsScreenTip}">
ToolTip="{DynamicResource Fluent.Ribbon.ScreenTips.Resources.RibbonTabControl.DisplayOptionsScreenTip}"
Visibility="{Binding IsDisplayOptionsButtonVisible, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource Fluent.Ribbon.Converters.BoolToVisibilityConverter}}">
<Fluent:MenuItem Header="{Binding Source={x:Static Fluent:RibbonLocalization.Current}, Path=Localization.ShowRibbon, Mode=OneWay}"
FontWeight="Bold"
Foreground="{DynamicResource Fluent.Ribbon.Brushes.Black}"
Expand Down Expand Up @@ -421,4 +422,4 @@
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ResourceDictionary>
</ResourceDictionary>

0 comments on commit 336efde

Please sign in to comment.