Skip to content

Commit 04715b8

Browse files
committed
Fix clock face background and color bindings
1 parent 9682ee0 commit 04715b8

File tree

4 files changed

+12
-11
lines changed

4 files changed

+12
-11
lines changed

BionicCode.Net/BionicCode.Controls.Net.Wpf/AnalogClockFace.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1367,7 +1367,7 @@ protected virtual void DrawAnalog24Clock()
13671367
Draw24HHourIntervals();
13681368
Draw24HMinuteIntervals();
13691369
Draw24HSecondIntervals();
1370-
Draw24ClockFaceBackground(this.IntervalMarkerMinuteCenterRadius);
1370+
Draw24ClockFaceBackground();
13711371
DrawTimePickerSelectionArcs();
13721372
if (!this.IsTimePickerModeEnabled || this.IsTimePickerClockHandVisible)
13731373
{
@@ -1799,9 +1799,9 @@ protected virtual void DrawTimePickerHoursSelectionBounds()
17991799
});
18001800
}
18011801

1802-
private void Draw24ClockFaceBackground(double intervalMarkerCenterPositionRadius)
1802+
private void Draw24ClockFaceBackground()
18031803
{
1804-
double deltaToMiddleRadius = (this.Radius - this.IntervalMarkerMinuteCenterRadius) * 2;
1804+
double deltaToMiddleRadius = (this.Radius - this.IntervalMarkerCenterRadius) * 2;
18051805
var clockFaceBackgroundPosition = new Point();
18061806
clockFaceBackgroundPosition.Offset(deltaToMiddleRadius / 2, deltaToMiddleRadius / 2);
18071807
var ellipse = new Ellipse()

BionicCode.Net/BionicCode.Controls.Net.Wpf/Themes/AnalogClockFaceStyle.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<SolidColorBrush Color="DodgerBlue" Opacity="0.6" />
1717
</Setter.Value>
1818
</Setter>
19-
<Setter Property="Background" Value="Transparent" />
19+
<Setter Property="Background" Value="#FF252526" />
2020
<Setter Property="FontSize" Value="8" />
2121
<Setter Property="FontStretch" Value="UltraExpanded" />
2222
<Setter Property="FontWeight" Value="UltraLight" />

BionicCode.Net/BionicCode.Controls.Net.Wpf/Themes/AnalogTimePickerStyle.xaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
<Setter.Value>
2020
<wpf:AnalogClockFace x:Name="AnalogClockFace"
2121
IsTimePickerModeEnabled="True"
22-
Is24HModeEnabled="True" />
22+
Is24HModeEnabled="True"
23+
Background="{Binding RelativeSource={RelativeSource AncestorType=wpf:AnalogTimePicker}, Path=Background}" />
2324
</Setter.Value>
2425
</Setter>
2526
<Setter Property="Template">
@@ -94,8 +95,8 @@
9495
<ScaleTransform x:Name="PopupScaleTransform"/>
9596
</Popup.RenderTransform>-->
9697
<Border BorderThickness="1"
97-
BorderBrush="DarkGray"
98-
Background="#24292E"
98+
BorderBrush="DimGray"
99+
Background="{TemplateBinding Background}"
99100
Margin="8"
100101
Padding="8">
101102
<Border.Effect>

BionicCode.Net/BionicCode.Net.Framework.Core.Ui.Test/MainWindow.xaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
xmlns:wpf="clr-namespace:BionicCode.Controls.Net.Wpf;assembly=BionicCode.Controls.Net.Wpf"
88
mc:Ignorable="d"
99
Title="MainWindow" Height="450" Width="800" Name="Window"
10-
Background="DimGray">
10+
Background="#FF252526">
1111
<Window.Resources>
1212
</Window.Resources>
1313
<Grid>
14-
<TextBlock Text="{Binding ElementName=TimePicker, Path=SelectedTime}"/>
15-
<wpf:AnalogTimePicker x:Name="TimePicker" Background="#24292E" Foreground="AntiqueWhite" IsClockHandVisible="False" Margin="0,20" />
16-
<!--<wpf:AnalogClockFace x:Name="TimePicker" Background="DimGray" IsTimePickerModeEnabled="False" SelectedTime="{Binding ElementName=Window, Path=CurrentDateTime}"/>-->
14+
<!--<TextBlock Text="{Binding ElementName=TimePicker, Path=SelectedTime}"/>
15+
<wpf:AnalogTimePicker x:Name="TimePicker" Background="#FF252526" Foreground="AntiqueWhite" IsClockHandVisible="False" Margin="0,20" />-->
16+
<wpf:AnalogClockFace x:Name="TimePicker" IsTimePickerModeEnabled="False" SelectedTime="{Binding ElementName=Window, Path=CurrentDateTime}"/>
1717
</Grid>
1818
<!--<StackPanel>
1919
<wpf:TimePicker x:Name="TimePicker" IsSecondsEnabled="True" IsOpen="True"/>

0 commit comments

Comments
 (0)