Skip to content

Commit

Permalink
Consistently use spaces in XAML
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalmers committed Jul 15, 2024
1 parent a8bed2c commit 4d3fa33
Show file tree
Hide file tree
Showing 2 changed files with 174 additions and 174 deletions.
2 changes: 1 addition & 1 deletion DesktopClock/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources />
<Application.Resources />
</Application>
346 changes: 173 additions & 173 deletions DesktopClock/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,179 +24,179 @@
ContentRendered="Window_ContentRendered"
Closing="Window_Closing"
StateChanged="Window_StateChanged">
<Window.Resources>
<ContextMenu x:Key="MainContextMenu" x:Shared="False">
<MenuItem Command="{Binding CopyToClipboardCommand}" Header="_Copy" />
<Window.Resources>
<ContextMenu x:Key="MainContextMenu" x:Shared="False">
<MenuItem Command="{Binding CopyToClipboardCommand}" Header="_Copy" />

<MenuItem Command="{Binding HideForNowCommand}" Header="_Hide for now" />
<MenuItem Command="{Binding HideForNowCommand}" Header="_Hide for now" />

<Separator />

<MenuItem Header="Stay on _top"
IsCheckable="True"
IsChecked="{Binding Topmost, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem Header="Show icon in tas_kbar"
IsCheckable="True"
IsChecked="{Binding ShowInTaskbar, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem Header="Start with _PC"
IsCheckable="True"
IsChecked="{Binding RunOnStartup, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem Header="Show _background"
IsCheckable="True"
IsChecked="{Binding BackgroundEnabled, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem Header="_Drag to move"
IsCheckable="True"
IsChecked="{Binding DragToMove, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem>
<MenuItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Size: " />

<Slider Width="80"
Maximum="{x:Static local:MainWindow.MaxSizeLog}"
Minimum="{x:Static local:MainWindow.MinSizeLog}"
Value="{Binding Height, Converter={local:LogScaleConverter}, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />
</StackPanel>
</MenuItem.Header>
</MenuItem>

<MenuItem Header="The_me" ItemsSource="{x:Static local:Theme.DefaultThemes}">
<MenuItem.Resources>
<Style TargetType="MenuItem">
<Setter Property="Command" Value="{Binding DataContext.SetThemeCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

<Setter Property="CommandParameter" Value="{Binding}" />

<Setter Property="DisplayMemberPath" Value="Name" />
</Style>
</MenuItem.Resources>
</MenuItem>

<MenuItem Header="Time _Zone" ItemsSource="{x:Static local:DateTimeUtil.TimeZones}">
<MenuItem.Resources>
<Style TargetType="MenuItem">
<Setter Property="Command" Value="{Binding DataContext.SetTimeZoneCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

<Setter Property="CommandParameter" Value="{Binding}" />
</Style>
</MenuItem.Resources>
</MenuItem>

<MenuItem Header="_Format" ItemsSource="{x:Static local:DateFormatExample.DefaultExamples}">
<MenuItem.Resources>
<Style TargetType="MenuItem">
<Style.Triggers>
<DataTrigger Binding="{Binding}" Value="{x:Static local:DateFormatExample.Tutorial}">
<Setter Property="Command" Value="{Binding DataContext.FormatWizardCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

<Setter Property="IsEnabled" Value="{x:Static p:Settings.CanBeSaved}" />
</DataTrigger>
</Style.Triggers>

<Setter Property="Command" Value="{Binding DataContext.SetFormatCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

<Setter Property="CommandParameter" Value="{Binding Format}" />

<Setter Property="DisplayMemberPath" Value="Example" />
</Style>
</MenuItem.Resources>
</MenuItem>

<Separator />

<MenuItem Command="{Binding NewClockCommand}"
Header="_New clock..."
IsEnabled="{x:Static p:Settings.CanBeSaved}" />

<MenuItem Command="{Binding CountdownWizardCommand}"
Header="_Countdown to..."
IsEnabled="{x:Static p:Settings.CanBeSaved}" />

<MenuItem Command="{Binding OpenSettingsCommand}"
Header="Advanced _settings"
IsEnabled="{x:Static p:Settings.CanBeSaved}" />

<MenuItem Command="{Binding CheckForUpdatesCommand}" Header="Check for _updates" />

<MenuItem Command="{Binding ExitCommand}" Header="E_xit" />
</ContextMenu>

<tb:TaskbarIcon x:Key="TrayIcon"
x:Shared="False"
IconSource="DesktopClock.ico"
ToolTipText="DesktopClock"
MenuActivation="LeftOrRightClick" />
</Window.Resources>

<Viewbox Height="{Binding Height, Source={x:Static p:Settings.Default}, Mode=OneWay}">
<Border CornerRadius="{Binding BackgroundCornerRadius, Source={x:Static p:Settings.Default}, Mode=OneWay}" Padding="1,0,1,0">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Background" Value="Transparent" />

<Style.Triggers>
<DataTrigger Binding="{Binding BackgroundEnabled, Source={x:Static p:Settings.Default}, Mode=OneWay}" Value="True">
<DataTrigger.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="{Binding BackgroundImagePath, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</Setter.Value>
</Setter>
</DataTrigger.Setters>
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding BackgroundEnabled, Source={x:Static p:Settings.Default}, Mode=OneWay}" Value="True" />
<Condition Binding="{Binding BackgroundImagePath, Source={x:Static p:Settings.Default}, Mode=OneWay}" Value="" />
</MultiDataTrigger.Conditions>

<MultiDataTrigger.Setters>
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Opacity="{Binding BackgroundOpacity, Source={x:Static p:Settings.Default}, Mode=OneWay}" Color="{Binding OuterColor, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</Setter.Value>
</Setter>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</Border.Style>

<local:OutlinedTextBlock Text="{Binding CurrentTimeOrCountdownString}"
StrokeThickness="{Binding OutlineThickness, Source={x:Static p:Settings.Default}, Mode=OneWay}"
TextWrapping="Wrap">

<local:OutlinedTextBlock.Fill>
<SolidColorBrush Color="{Binding TextColor, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</local:OutlinedTextBlock.Fill>

<local:OutlinedTextBlock.Style>
<Style TargetType="local:OutlinedTextBlock">
<Setter Property="Stroke" Value="Transparent" />
<Setter Property="Margin" Value="0" />

<Style.Triggers>
<DataTrigger Binding="{Binding BackgroundEnabled, Source={x:Static p:Settings.Default}, Mode=OneWay}" Value="False">
<DataTrigger.Setters>
<Setter Property="Stroke">
<Setter.Value>
<SolidColorBrush Color="{Binding OuterColor, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</Setter.Value>
</Setter>

<Setter Property="Margin" Value="{Binding OutlineThickness, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</DataTrigger.Setters>
</DataTrigger>
</Style.Triggers>
</Style>
</local:OutlinedTextBlock.Style>
</local:OutlinedTextBlock>
</Border>
</Viewbox>
<Separator />

<MenuItem Header="Stay on _top"
IsCheckable="True"
IsChecked="{Binding Topmost, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem Header="Show icon in tas_kbar"
IsCheckable="True"
IsChecked="{Binding ShowInTaskbar, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem Header="Start with _PC"
IsCheckable="True"
IsChecked="{Binding RunOnStartup, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem Header="Show _background"
IsCheckable="True"
IsChecked="{Binding BackgroundEnabled, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem Header="_Drag to move"
IsCheckable="True"
IsChecked="{Binding DragToMove, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />

<MenuItem>
<MenuItem.Header>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Size: " />

<Slider Width="80"
Maximum="{x:Static local:MainWindow.MaxSizeLog}"
Minimum="{x:Static local:MainWindow.MinSizeLog}"
Value="{Binding Height, Converter={local:LogScaleConverter}, Source={x:Static p:Settings.Default}, Mode=TwoWay}" />
</StackPanel>
</MenuItem.Header>
</MenuItem>

<MenuItem Header="The_me" ItemsSource="{x:Static local:Theme.DefaultThemes}">
<MenuItem.Resources>
<Style TargetType="MenuItem">
<Setter Property="Command" Value="{Binding DataContext.SetThemeCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

<Setter Property="CommandParameter" Value="{Binding}" />

<Setter Property="DisplayMemberPath" Value="Name" />
</Style>
</MenuItem.Resources>
</MenuItem>

<MenuItem Header="Time _Zone" ItemsSource="{x:Static local:DateTimeUtil.TimeZones}">
<MenuItem.Resources>
<Style TargetType="MenuItem">
<Setter Property="Command" Value="{Binding DataContext.SetTimeZoneCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

<Setter Property="CommandParameter" Value="{Binding}" />
</Style>
</MenuItem.Resources>
</MenuItem>

<MenuItem Header="_Format" ItemsSource="{x:Static local:DateFormatExample.DefaultExamples}">
<MenuItem.Resources>
<Style TargetType="MenuItem">
<Style.Triggers>
<DataTrigger Binding="{Binding}" Value="{x:Static local:DateFormatExample.Tutorial}">
<Setter Property="Command" Value="{Binding DataContext.FormatWizardCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

<Setter Property="IsEnabled" Value="{x:Static p:Settings.CanBeSaved}" />
</DataTrigger>
</Style.Triggers>

<Setter Property="Command" Value="{Binding DataContext.SetFormatCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

<Setter Property="CommandParameter" Value="{Binding Format}" />

<Setter Property="DisplayMemberPath" Value="Example" />
</Style>
</MenuItem.Resources>
</MenuItem>

<Separator />

<MenuItem Command="{Binding NewClockCommand}"
Header="_New clock..."
IsEnabled="{x:Static p:Settings.CanBeSaved}" />

<MenuItem Command="{Binding CountdownWizardCommand}"
Header="_Countdown to..."
IsEnabled="{x:Static p:Settings.CanBeSaved}" />

<MenuItem Command="{Binding OpenSettingsCommand}"
Header="Advanced _settings"
IsEnabled="{x:Static p:Settings.CanBeSaved}" />

<MenuItem Command="{Binding CheckForUpdatesCommand}" Header="Check for _updates" />

<MenuItem Command="{Binding ExitCommand}" Header="E_xit" />
</ContextMenu>

<tb:TaskbarIcon x:Key="TrayIcon"
x:Shared="False"
IconSource="DesktopClock.ico"
ToolTipText="DesktopClock"
MenuActivation="LeftOrRightClick" />
</Window.Resources>

<Viewbox Height="{Binding Height, Source={x:Static p:Settings.Default}, Mode=OneWay}">
<Border CornerRadius="{Binding BackgroundCornerRadius, Source={x:Static p:Settings.Default}, Mode=OneWay}" Padding="1,0,1,0">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Background" Value="Transparent" />

<Style.Triggers>
<DataTrigger Binding="{Binding BackgroundEnabled, Source={x:Static p:Settings.Default}, Mode=OneWay}" Value="True">
<DataTrigger.Setters>
<Setter Property="Background">
<Setter.Value>
<ImageBrush ImageSource="{Binding BackgroundImagePath, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</Setter.Value>
</Setter>
</DataTrigger.Setters>
</DataTrigger>

<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding BackgroundEnabled, Source={x:Static p:Settings.Default}, Mode=OneWay}" Value="True" />
<Condition Binding="{Binding BackgroundImagePath, Source={x:Static p:Settings.Default}, Mode=OneWay}" Value="" />
</MultiDataTrigger.Conditions>

<MultiDataTrigger.Setters>
<Setter Property="Background">
<Setter.Value>
<SolidColorBrush Opacity="{Binding BackgroundOpacity, Source={x:Static p:Settings.Default}, Mode=OneWay}" Color="{Binding OuterColor, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</Setter.Value>
</Setter>
</MultiDataTrigger.Setters>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</Border.Style>

<local:OutlinedTextBlock Text="{Binding CurrentTimeOrCountdownString}"
StrokeThickness="{Binding OutlineThickness, Source={x:Static p:Settings.Default}, Mode=OneWay}"
TextWrapping="Wrap">

<local:OutlinedTextBlock.Fill>
<SolidColorBrush Color="{Binding TextColor, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</local:OutlinedTextBlock.Fill>

<local:OutlinedTextBlock.Style>
<Style TargetType="local:OutlinedTextBlock">
<Setter Property="Stroke" Value="Transparent" />
<Setter Property="Margin" Value="0" />

<Style.Triggers>
<DataTrigger Binding="{Binding BackgroundEnabled, Source={x:Static p:Settings.Default}, Mode=OneWay}" Value="False">
<DataTrigger.Setters>
<Setter Property="Stroke">
<Setter.Value>
<SolidColorBrush Color="{Binding OuterColor, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</Setter.Value>
</Setter>

<Setter Property="Margin" Value="{Binding OutlineThickness, Source={x:Static p:Settings.Default}, Mode=OneWay}" />
</DataTrigger.Setters>
</DataTrigger>
</Style.Triggers>
</Style>
</local:OutlinedTextBlock.Style>
</local:OutlinedTextBlock>
</Border>
</Viewbox>
</Window>

0 comments on commit 4d3fa33

Please sign in to comment.