Skip to content

Commit 9d4147b

Browse files
committed
Blackout styles with strike-through.
Minimal visual regression.
1 parent 6478a18 commit 9d4147b

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

MainDemo.Wpf/Pickers.xaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
<ColumnDefinition Width="Auto" />
2020
</Grid.ColumnDefinitions>
2121
<TextBlock Grid.ColumnSpan="3">Classic WPF DatePicker control with Material Design theme, and new TimePicker control:</TextBlock>
22-
<DatePicker Grid.Row="1" Grid.Column="0" Width="100" HorizontalAlignment="Left" Margin="0 16 0 0"
23-
materialDesign:TextFieldAssist.Hint="Pick Date"/>
22+
<StackPanel Grid.Row="1" Grid.Column="0">
23+
<DatePicker Width="100" HorizontalAlignment="Left" Margin="0 16 0 0" materialDesign:TextFieldAssist.Hint="Pick Date" />
24+
<DatePicker x:Name="FutureDatePicker" Width="100" HorizontalAlignment="Left" Margin="0 16 0 0" materialDesign:TextFieldAssist.Hint="Future Date" />
25+
</StackPanel>
2426
<materialDesign:TimePicker Grid.Row="1" Grid.Column="1" VerticalAlignment="Top" Width="100" HorizontalAlignment="Left" Margin="0 16 0 0"
2527
materialDesign:TextFieldAssist.Hint="Custom hint" />
2628
<materialDesign:TimePicker Grid.Row="1" Grid.Column="2" Is24Hours="True" x:Name="PresetTimePicker" VerticalAlignment="Top" Width="100" HorizontalAlignment="Left" Margin="0 16 0 0" />

MainDemo.Wpf/Pickers.xaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public partial class Pickers : UserControl
2424
public Pickers()
2525
{
2626
InitializeComponent();
27+
FutureDatePicker.BlackoutDates.AddDatesInPast();
2728
}
2829

2930
public void CalendarDialogOpenedEventHandler(object sender, DialogOpenedEventArgs eventArgs)

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Calendar.xaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@
226226
<VisualState x:Name="Active"/>
227227
<VisualState x:Name="Inactive">
228228
<Storyboard>
229-
<DoubleAnimation Duration="0" To="0.2" Storyboard.TargetProperty="Opacity"/>
229+
<DoubleAnimation Duration="0" To="0.35" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="NormalText"/>
230230
</Storyboard>
231231
</VisualState>
232232
</VisualStateGroup>
@@ -251,7 +251,7 @@
251251
<VisualState x:Name="NormalDay"/>
252252
<VisualState x:Name="BlackoutDay">
253253
<Storyboard>
254-
<DoubleAnimation Duration="0" To=".2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Blackout"/>
254+
<DoubleAnimation Duration="0" To="0.2" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Blackout"/>
255255
</Storyboard>
256256
</VisualState>
257257
</VisualStateGroup>
@@ -262,12 +262,14 @@
262262
<Ellipse x:Name="HighlightBackground" Fill="{DynamicResource PrimaryHueDarkBrush}" Opacity="0" />
263263
<ContentPresenter x:Name="NormalText" TextElement.Foreground="{TemplateBinding Foreground}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="5,1,5,1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
264264
<Path x:Name="Blackout"
265-
Data="M8.1772461,11.029181 L10.433105,11.029181 L11.700684,12.801641 L12.973633,11.029181 L15.191895,11.029181 L12.844727,13.999395 L15.21875,17.060919 L12.962891,17.060919 L11.673828,15.256231 L10.352539,17.060919 L8.1396484,17.060919 L10.519043,14.042364 z"
266-
Fill="#FF000000"
267-
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
265+
Data="M 16 0 l -16 16"
266+
StrokeThickness="1.5"
267+
Stroke="#FF000000"
268+
HorizontalAlignment="Stretch"
269+
VerticalAlignment="Stretch"
268270
Margin="3"
269-
Opacity="0"
270-
RenderTransformOrigin="0.5,0.5"
271+
Opacity="0"
272+
RenderTransformOrigin="0.5,0.5"
271273
Stretch="Fill"/>
272274
<Ellipse x:Name="DayButtonFocusVisual" Stroke="{DynamicResource PrimaryHueDarkBrush}" Opacity="0" Visibility="Collapsed" StrokeThickness="1"/>
273275
</Grid>

0 commit comments

Comments
 (0)