Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IsDisplayOptionsButtonVisible property is added to RibbonTabControl #1049

Merged
merged 2 commits into from
Aug 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>