Flyout MaxWidth #6798
-
How do I change the max width of a particular flyout when using the (dark) fluent theme? The fluent theme's style for the FlyoutPresenter seems to set a max width: <Setter Property="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth" which, in the BaseDark.xaml at least, is defined as: <x:Double x:Key="FlyoutThemeMaxWidth">456</x:Double> But I can't seem to figure out how to change that style for a specific flyout. Is there a reason why the fluent themed flyout has a max width (and a max height)? The default theme doesn't seem to set those. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
While I don't have an answer as to why the Flyout has a MaxWidth in the Fluent theme, restyling a specific Flyout is pretty straightforward. Just set <Flyout Flyout.FlyoutPresenterClasses="wider">
<TextBlock Text="This would normally show a Scrollbar" Width="800"/>
</Flyout> <Style Selector="FlyoutPresenter.wider">
<Setter Property="MaxWidth" Value="850"/>
</Style> |
Beta Was this translation helpful? Give feedback.
While I don't have an answer as to why the Flyout has a MaxWidth in the Fluent theme, restyling a specific Flyout is pretty straightforward.
Just set
Flyout.FlyoutPresenterClasses
on yourFlyout
and then you can reference it in your style, e.g.: