mirror of
https://github.com/ckaczor/WorldClockStatusWindow.git
synced 2026-01-13 17:23:18 -05:00
Start working on settings UI
This commit is contained in:
21
SettingsWindow/AboutSettingsPanel.xaml
Normal file
21
SettingsWindow/AboutSettingsPanel.xaml
Normal file
@@ -0,0 +1,21 @@
|
||||
<windows:CategoryPanelBase x:Class="WorldClockStatusWindow.SettingsWindow.AboutSettingsPanel"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:properties="clr-namespace:WorldClockStatusWindow.Properties"
|
||||
xmlns:worldClockStatusWindow="clr-namespace:WorldClockStatusWindow"
|
||||
xmlns:windows="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.CategoryWindow"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="150"
|
||||
d:DesignWidth="300">
|
||||
<Grid>
|
||||
<StackPanel windows:Spacing.Vertical="10">
|
||||
<TextBlock Text="{x:Static properties:Resources.ApplicationName}"
|
||||
FontWeight="Bold" />
|
||||
<TextBlock Text="{Binding Source={x:Static worldClockStatusWindow:Program.LocalVersion}, StringFormat={x:Static properties:Resources.Version}}"
|
||||
Name="VersionLabel" />
|
||||
<TextBlock Text="Chris Kaczor" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</windows:CategoryPanelBase>
|
||||
12
SettingsWindow/AboutSettingsPanel.xaml.cs
Normal file
12
SettingsWindow/AboutSettingsPanel.xaml.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
namespace WorldClockStatusWindow.SettingsWindow
|
||||
{
|
||||
public partial class AboutSettingsPanel
|
||||
{
|
||||
public AboutSettingsPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public override string CategoryName => Properties.Resources.optionCategoryAbout;
|
||||
}
|
||||
}
|
||||
16
SettingsWindow/GeneralSettingsPanel.xaml
Normal file
16
SettingsWindow/GeneralSettingsPanel.xaml
Normal file
@@ -0,0 +1,16 @@
|
||||
<windows:CategoryPanelBase x:Class="WorldClockStatusWindow.SettingsWindow.GeneralSettingsPanel"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:properties="clr-namespace:WorldClockStatusWindow.Properties"
|
||||
xmlns:windows="clr-namespace:ChrisKaczor.Wpf.Windows;assembly=ChrisKaczor.Wpf.Windows.CategoryWindow"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="300"
|
||||
d:DesignWidth="300">
|
||||
<StackPanel windows:Spacing.Vertical="10">
|
||||
<CheckBox Content="{x:Static properties:Resources.startWithWindowsCheckBox}"
|
||||
IsChecked="{Binding Source={x:Static properties:Settings.Default}, Path=AutoStart}"
|
||||
Click="OnSaveSettings" />
|
||||
</StackPanel>
|
||||
</windows:CategoryPanelBase>
|
||||
36
SettingsWindow/GeneralSettingsPanel.xaml.cs
Normal file
36
SettingsWindow/GeneralSettingsPanel.xaml.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using ChrisKaczor.Wpf.Application;
|
||||
using System.Windows;
|
||||
using WorldClockStatusWindow.Properties;
|
||||
|
||||
namespace WorldClockStatusWindow.SettingsWindow;
|
||||
|
||||
public partial class GeneralSettingsPanel
|
||||
{
|
||||
public GeneralSettingsPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public override string CategoryName => Properties.Resources.optionCategoryGeneral;
|
||||
|
||||
public override void LoadPanel(Window parentWindow)
|
||||
{
|
||||
base.LoadPanel(parentWindow);
|
||||
|
||||
MarkLoaded();
|
||||
}
|
||||
|
||||
private void OnSaveSettings(object sender, RoutedEventArgs e)
|
||||
{
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
private void SaveSettings()
|
||||
{
|
||||
if (!HasLoaded) return;
|
||||
|
||||
Settings.Default.Save();
|
||||
|
||||
Application.Current.SetStartWithWindows(Settings.Default.AutoStart);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user