Skip to content

Commit bb4318c

Browse files
committed
💄 Formatting and xaml refactoring
Move inline button properties into styles
1 parent b613a82 commit bb4318c

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

SeeGitApp/MainWindow.xaml

+28-23
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,11 @@
3232
</Window.Resources>
3333

3434
<Window.CommandBindings>
35-
<CommandBinding Command="Refresh"
36-
Executed="OnRefresh" />
35+
<CommandBinding Command="Refresh" Executed="OnRefresh" />
3736
</Window.CommandBindings>
3837

3938
<Window.InputBindings>
40-
<KeyBinding Key="F5"
41-
Command="Refresh" />
39+
<KeyBinding Key="F5" Command="Refresh" />
4240
</Window.InputBindings>
4341

4442
<Grid d:DataContext="{d:DesignInstance {x:Type local:DesignTimeMainWindowViewModel}, IsDesignTimeCreatable=True}">
@@ -49,27 +47,34 @@
4947

5048
<StackPanel Orientation="Vertical" Grid.Row="0" Background="Black" >
5149
<StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" Margin="6" FlowDirection="LeftToRight">
52-
<Label VerticalAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="10"
53-
FontFamily="Verdana" FontWeight="Bold" Margin="0,0,2,0" Padding="0" Content="Repository:" />
54-
<Label VerticalAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="10"
55-
FontFamily="Verdana" FontWeight="Bold" Margin="0,0,6,0" Padding="0" Content="{Binding RepositoryPath}" />
56-
<Button Background="Gray" Foreground="White" HorizontalAlignment="Right" Margin="10 2 0 2" Padding="3" Focusable="False"
57-
Click="OnChooseRepository">
58-
Browse...
59-
</Button>
60-
<Button Background="Gray" Foreground="White" HorizontalAlignment="Right" Margin="10 2 0 2" Padding="3" Focusable="False"
61-
Command="Refresh">
62-
Refresh
63-
</Button>
64-
<ToggleButton Name="settingsToggle" Background="Gray" Foreground="White" HorizontalAlignment="Right" Margin="10 2 0 2" Padding="3" Focusable="False"
65-
Click="OnToggleSettings">
66-
Settings
67-
</ToggleButton>
50+
51+
<StackPanel.Resources>
52+
<Style TargetType="{x:Type Label}">
53+
<Setter Property="VerticalAlignment" Value="Center" />
54+
<Setter Property="Foreground" Value="White" />
55+
<Setter Property="FontWeight" Value="Bold" />
56+
<Setter Property="Padding" Value="0" />
57+
<Setter Property="Margin" Value="0" />
58+
</Style>
59+
<Style TargetType="{x:Type ButtonBase}" x:Key="buttonStyle">
60+
<Setter Property="Background" Value="Gray" />
61+
<Setter Property="Foreground" Value="White" />
62+
<Setter Property="HorizontalContentAlignment" Value="Center" />
63+
<Setter Property="Margin" Value="0,2,6,2" />
64+
<Setter Property="Padding" Value="3" />
65+
</Style>
66+
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource buttonStyle}" />
67+
<Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource buttonStyle}" />
68+
</StackPanel.Resources>
69+
70+
<Label Margin="0,0,2,0" Content="Repository:" />
71+
<Label Margin="0,0,6,0" Content="{Binding RepositoryPath}" />
72+
<Button Click="OnChooseRepository" Content="Browse…" />
73+
<Button Command="Refresh" Content="Refresh" />
74+
<ToggleButton Name="settingsToggle" Click="OnToggleSettings" Content="Settings" />
6875
</StackPanel>
6976
<StackPanel Visibility="{Binding IsChecked, ElementName=settingsToggle, Converter={StaticResource BooleanToVisibilityConverter}}">
70-
<view:SettingsView>
71-
72-
</view:SettingsView>
77+
<view:SettingsView />
7378
</StackPanel>
7479
</StackPanel>
7580

0 commit comments

Comments
 (0)