Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara committed Jul 10, 2022
1 parent 8a2bfa6 commit 6c1c07c
Show file tree
Hide file tree
Showing 7 changed files with 139 additions and 216 deletions.
246 changes: 101 additions & 145 deletions ModernWpf.Controls/ContentDialog/ContentDialog.xaml

Large diffs are not rendered by default.

9 changes: 0 additions & 9 deletions ModernWpf.SampleApp/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,6 @@
<Setter Property="Spacing" Value="16" />
</Style>

<Style x:Key="ScrollableContentDialogStyle" TargetType="ui:ContentDialog">
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Style.Resources>
<Thickness x:Key="ContentDialogContentMargin">24,0,24,0</Thickness>
<Thickness x:Key="ContentDialogContentScrollViewerMargin">-24,0,-24,0</Thickness>
<Thickness x:Key="ContentDialogTitleMargin">24,0,24,12</Thickness>
</Style.Resources>
</Style>

<Style x:Key="ControlExampleFullStyle" TargetType="sc:ControlExample">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
Expand Down
1 change: 0 additions & 1 deletion ModernWpf.SampleApp/ControlPages/TestContentDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
d:DesignHeight="756"
d:DesignWidth="548"
x:Name="dialog"
Style="{StaticResource ScrollableContentDialogStyle}"
Title="Title"
PrimaryButtonText="Yes"
SecondaryButtonText="No"
Expand Down
22 changes: 22 additions & 0 deletions ModernWpf/Controls/BorderEx.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace ModernWpf.Controls
{
public class BorderEx : Border
{
protected override Geometry GetLayoutClip(Size layoutSlotSize)
{
if (ClipToBounds)
{
var radius = CornerRadius.TopLeft;
var rect = new RectangleGeometry(new Rect(layoutSlotSize), radius, radius);
rect.Freeze();
return rect;
}

return base.GetLayoutClip(layoutSlotSize);
}
}
}
25 changes: 5 additions & 20 deletions ModernWpf/ThemeResources/Dark.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -811,27 +811,12 @@
<m:StaticResource x:Key="CommandBarFlyoutButtonBackground" ResourceKey="SystemControlTransparentBrush" />

<!-- Resources for ContentDialog -->
<sys:Double x:Key="ContentDialogMinWidth">320</sys:Double>
<sys:Double x:Key="ContentDialogMaxWidth">548</sys:Double>
<sys:Double x:Key="ContentDialogMinHeight">184</sys:Double>
<sys:Double x:Key="ContentDialogMaxHeight">756</sys:Double>
<sys:Double x:Key="ContentDialogButtonMinWidth">130</sys:Double>
<sys:Double x:Key="ContentDialogButtonMaxWidth">202</sys:Double>
<sys:Double x:Key="ContentDialogButtonMinHeight">32</sys:Double>
<sys:Double x:Key="ContentDialogButtonHeight">32</sys:Double>
<sys:Double x:Key="ContentDialogTitleMaxHeight">56</sys:Double>
<m:StaticResource x:Key="ContentDialogForeground" ResourceKey="TextFillColorPrimaryBrush" />
<m:StaticResource x:Key="ContentDialogBackground" ResourceKey="SolidBackgroundFillColorBaseBrush" />
<m:StaticResource x:Key="ContentDialogSmokeFill" ResourceKey="SmokeFillColorDefaultBrush" />
<m:StaticResource x:Key="ContentDialogTopOverlay" ResourceKey="SolidBackgroundFillColorQuarternaryBrush" />
<m:StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="ControlElevationBorderBrush" />
<Thickness x:Key="ContentDialogBorderWidth">1</Thickness>
<Thickness x:Key="ContentDialogButton1HostMargin">0,0,4,0</Thickness>
<Thickness x:Key="ContentDialogButton2HostMargin">0,0,0,0</Thickness>
<Thickness x:Key="ContentDialogContentMargin">0,0,0,0</Thickness>
<Thickness x:Key="ContentDialogContentScrollViewerMargin">0,0,0,0</Thickness>
<Thickness x:Key="ContentDialogCommandSpaceMargin">0,24,0,0</Thickness>
<Thickness x:Key="ContentDialogTitleMargin">0,0,0,12</Thickness>
<Thickness x:Key="ContentDialogPadding">24,18,24,24</Thickness>
<m:StaticResource x:Key="ContentDialogForeground" ResourceKey="SystemControlPageTextBaseHighBrush" />
<m:StaticResource x:Key="ContentDialogBackground" ResourceKey="SystemControlPageBackgroundAltHighBrush" />
<m:StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<m:StaticResource x:Key="ContentDialogLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />

<!-- Resources for DataGrid -->
<sys:Double x:Key="ListAccentLowOpacity">0.6</sys:Double>
Expand Down
27 changes: 6 additions & 21 deletions ModernWpf/ThemeResources/HighContrast.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -690,27 +690,12 @@
<SolidColorBrush x:Key="CommandBarFlyoutButtonBackground" Color="{m:ThemeResource SystemColorButtonFaceColor}" />

<!-- Resources for ContentDialog -->
<sys:Double x:Key="ContentDialogMinWidth">320</sys:Double>
<sys:Double x:Key="ContentDialogMaxWidth">548</sys:Double>
<sys:Double x:Key="ContentDialogMinHeight">184</sys:Double>
<sys:Double x:Key="ContentDialogMaxHeight">756</sys:Double>
<sys:Double x:Key="ContentDialogButtonMinWidth">130</sys:Double>
<sys:Double x:Key="ContentDialogButtonMaxWidth">202</sys:Double>
<sys:Double x:Key="ContentDialogButtonMinHeight">32</sys:Double>
<sys:Double x:Key="ContentDialogButtonHeight">32</sys:Double>
<sys:Double x:Key="ContentDialogTitleMaxHeight">56</sys:Double>
<Thickness x:Key="ContentDialogBorderWidth">1</Thickness>
<Thickness x:Key="ContentDialogButton1HostMargin">0,0,4,0</Thickness>
<Thickness x:Key="ContentDialogButton2HostMargin">0,0,0,0</Thickness>
<Thickness x:Key="ContentDialogContentMargin">0,0,0,0</Thickness>
<Thickness x:Key="ContentDialogContentScrollViewerMargin">0,0,0,0</Thickness>
<Thickness x:Key="ContentDialogCommandSpaceMargin">0,24,0,0</Thickness>
<Thickness x:Key="ContentDialogTitleMargin">0,0,0,12</Thickness>
<Thickness x:Key="ContentDialogPadding">24,18,24,24</Thickness>
<m:StaticResource x:Key="ContentDialogForeground" ResourceKey="SystemControlPageTextBaseHighBrush" />
<m:StaticResource x:Key="ContentDialogBackground" ResourceKey="SystemControlPageBackgroundAltHighBrush" />
<m:StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<m:StaticResource x:Key="ContentDialogLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />
<m:StaticResource x:Key="ContentDialogForeground" ResourceKey="SystemColorWindowTextColorBrush" />
<m:StaticResource x:Key="ContentDialogBackground" ResourceKey="SystemColorWindowColorBrush" />
<m:StaticResource x:Key="ContentDialogSmokeFill" ResourceKey="SystemColorWindowColorBrush" />
<m:StaticResource x:Key="ContentDialogTopOverlay" ResourceKey="SystemControlTransparentBrush" />
<m:StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="SystemColorWindowTextColorBrush" />
<Thickness x:Key="ContentDialogBorderWidth">2</Thickness>

<!-- Resources for DataGrid -->
<sys:Double x:Key="ListAccentLowOpacity">0.6</sys:Double>
Expand Down
25 changes: 5 additions & 20 deletions ModernWpf/ThemeResources/Light.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -811,27 +811,12 @@
<m:StaticResource x:Key="CommandBarFlyoutButtonBackground" ResourceKey="SystemControlTransparentBrush" />

<!-- Resources for ContentDialog -->
<sys:Double x:Key="ContentDialogMinWidth">320</sys:Double>
<sys:Double x:Key="ContentDialogMaxWidth">548</sys:Double>
<sys:Double x:Key="ContentDialogMinHeight">184</sys:Double>
<sys:Double x:Key="ContentDialogMaxHeight">756</sys:Double>
<sys:Double x:Key="ContentDialogButtonMinWidth">130</sys:Double>
<sys:Double x:Key="ContentDialogButtonMaxWidth">202</sys:Double>
<sys:Double x:Key="ContentDialogButtonMinHeight">32</sys:Double>
<sys:Double x:Key="ContentDialogButtonHeight">32</sys:Double>
<sys:Double x:Key="ContentDialogTitleMaxHeight">56</sys:Double>
<m:StaticResource x:Key="ContentDialogForeground" ResourceKey="TextFillColorPrimaryBrush" />
<m:StaticResource x:Key="ContentDialogBackground" ResourceKey="SolidBackgroundFillColorBaseBrush" />
<m:StaticResource x:Key="ContentDialogSmokeFill" ResourceKey="SmokeFillColorDefaultBrush" />
<m:StaticResource x:Key="ContentDialogTopOverlay" ResourceKey="SolidBackgroundFillColorQuarternaryBrush" />
<m:StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="ControlElevationBorderBrush" />
<Thickness x:Key="ContentDialogBorderWidth">1</Thickness>
<Thickness x:Key="ContentDialogButton1HostMargin">0,0,4,0</Thickness>
<Thickness x:Key="ContentDialogButton2HostMargin">0,0,0,0</Thickness>
<Thickness x:Key="ContentDialogContentMargin">0,0,0,0</Thickness>
<Thickness x:Key="ContentDialogContentScrollViewerMargin">0,0,0,0</Thickness>
<Thickness x:Key="ContentDialogCommandSpaceMargin">0,24,0,0</Thickness>
<Thickness x:Key="ContentDialogTitleMargin">0,0,0,12</Thickness>
<Thickness x:Key="ContentDialogPadding">24,18,24,24</Thickness>
<m:StaticResource x:Key="ContentDialogForeground" ResourceKey="SystemControlPageTextBaseHighBrush" />
<m:StaticResource x:Key="ContentDialogBackground" ResourceKey="SystemControlPageBackgroundAltHighBrush" />
<m:StaticResource x:Key="ContentDialogBorderBrush" ResourceKey="SystemControlBackgroundBaseLowBrush" />
<m:StaticResource x:Key="ContentDialogLightDismissOverlayBackground" ResourceKey="SystemControlPageBackgroundMediumAltMediumBrush" />

<!-- Resources for DataGrid -->
<sys:Double x:Key="ListAccentLowOpacity">0.4</sys:Double>
Expand Down

0 comments on commit 6c1c07c

Please sign in to comment.