Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara authored Oct 15, 2023
1 parent 6580ce2 commit 7a18364
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 23 deletions.
4 changes: 1 addition & 3 deletions ModernWpf.Controls/ContentDialog/ContentDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,8 @@
IsShadowEnabled="{TemplateBinding IsShadowEnabled}"
CornerRadius="{TemplateBinding CornerRadius}"
Margin="{DynamicResource ContentDialogBorderWidth}" />
<Border
Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding CornerRadius}" />
<ui:BorderEx
Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
CornerRadius="{TemplateBinding CornerRadius}"
Expand Down
31 changes: 15 additions & 16 deletions ModernWpf.Controls/Flyout/FlyoutPresenter.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
xmlns:ui="http://schemas.modernwpf.com/2019"
xmlns:local="clr-namespace:ModernWpf.Controls">

<Thickness x:Key="FlyoutContentPadding">16,15,16,17</Thickness>

<Style TargetType="local:FlyoutPresenter">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
Expand All @@ -15,7 +17,7 @@
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource FlyoutBorderThemeBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource FlyoutBorderThemeThickness}" />
<Setter Property="Padding" Value="{DynamicResource FlyoutContentThemePadding}" />
<Setter Property="Padding" Value="{StaticResource FlyoutContentPadding}" />
<Setter Property="MinWidth" Value="{DynamicResource FlyoutThemeMinWidth}" />
<Setter Property="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" />
<Setter Property="MinHeight" Value="{DynamicResource FlyoutThemeMinHeight}" />
Expand All @@ -35,22 +37,19 @@
<Border
x:Name="LayoutRoot"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Border
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<ScrollViewer
x:Name="ScrollViewer"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer>
</Border>
<ScrollViewer
x:Name="ScrollViewer"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ContentPresenter
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ScrollViewer>
</Border>
</ui:ThemeShadowChrome>
</ControlTemplate>
Expand Down
25 changes: 22 additions & 3 deletions test/ModernWpfTestApp/CommonStylesPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -405,17 +405,36 @@
Style="{StaticResource DefaultRadioButtonStyle}"
Content="I am a RadioButton with DefaultRadioButtonStyle set" />

<ButtonEx Content="Test flyout">
<ButtonEx Content="Test flyout with text and button" Margin="0,24,0,0">
<ButtonEx.Flyout>
<Flyout>
<StackPanel>
<TextBlock Style="{DynamicResource BaseTextBlockStyle}" Text="All items will be removed. Do you want to continue?" Margin="0,0,0,12" />
<TextBlock Text="All items will be removed. Do you want to continue?" Margin="0,0,0,12" />
<Button Content="Yes, empty my cart" />
</StackPanel>
</Flyout>
</ButtonEx.Flyout>
</ButtonEx>


<ButtonEx Content="Test flyout with button and long text" Margin="0,24,0,0">
<ButtonEx.Flyout>
<Flyout>
<StackPanel Width="300">
<Button Content="Yes, empty my cart" Margin="0,0,0,12"/>
<TextBlock TextWrapping="Wrap" Text="The giant panda, also known as the panda bear or simply the panda, is a bear native to south central China. It is characterised by large, black patches around its eyes, over the ears, and across its round body. The name giant panda is sometimes used to distinguish it from the red panda, a neighboring musteloid. Though it belongs to the order Carnivora, the giant panda is a folivore, with bamboo shoots and leaves making up more than 99% of its diet.[7] Giant pandas in the wild will occasionally eat other grasses, wild tubers, or even meat in the form of birds, rodents, or carrion. In captivity, they may receive honey, eggs, fish, yams, shrub leaves, oranges, or bananas along with specially prepared food."/>
</StackPanel>
</Flyout>
</ButtonEx.Flyout>
</ButtonEx>

<ButtonEx Content="Test flyout with short text" Margin="0,24,0,0">
<ButtonEx.Flyout>
<Flyout>
<TextBlock Text="OK"/>
</Flyout>
</ButtonEx.Flyout>
</ButtonEx>

</StackPanel>
</Border>
<Border Style="{DynamicResource CompactBorderStyle}">
Expand Down
2 changes: 1 addition & 1 deletion test/ModernWpfTestApp/ContentDialogPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<StackPanel Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Margin="12">
<Button Content="Click to open simple ContentDialog" Click="ShowDialog_Click"/>
<Button Content="Click to open simple ContentDialog" Click="ShowDialog_Click" Margin="0,12,0,24"/>
<Button Content="Border thickness test dialog" Click="ShowBorderThickness_Click"/>
</StackPanel>
</local:TestPage>

0 comments on commit 7a18364

Please sign in to comment.