Change theme selection window to settings window

This commit is contained in:
deagahelio
2021-03-23 19:58:25 -03:00
parent 4e8533f842
commit 8074fe703e
4 changed files with 21 additions and 29 deletions

View File

@@ -8,7 +8,7 @@ namespace RedBookPlayer
{
public static MainWindow Instance;
public ContentControl ContentControl;
public Window themeSelectionWindow;
public Window settingsWindow;
public MainWindow()
{
@@ -20,8 +20,8 @@ namespace RedBookPlayer
{
if (e.Key == Key.F1)
{
themeSelectionWindow = new ThemeSelectionWindow();
themeSelectionWindow.Show();
settingsWindow = new SettingsWindow();
settingsWindow.Show();
}
}
@@ -42,8 +42,8 @@ namespace RedBookPlayer
this.KeyDown += OnKeyDown;
this.Closing += (s, e) =>
{
themeSelectionWindow?.Close();
themeSelectionWindow = null;
settingsWindow?.Close();
settingsWindow = null;
};
this.Closing += (e, f) =>

View File

@@ -0,0 +1,14 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="RedBookPlayer.SettingsWindow"
Title="Settings"
Width="450" Height="600">
<DockPanel Margin="16">
<TextBlock DockPanel.Dock="Top" Margin="0,0,0,4">Themes</TextBlock>
<Button DockPanel.Dock="Bottom" Name="ApplyButton">Apply</Button>
<ListBox Name="ThemeList" SelectionMode="Single" Margin="0,0,0,16"/>
</DockPanel>
</Window>

View File

@@ -7,12 +7,12 @@ using Avalonia.Markup.Xaml;
namespace RedBookPlayer
{
public class ThemeSelectionWindow : Window
public class SettingsWindow : Window
{
ListBox themeList;
string selectedTheme;
public ThemeSelectionWindow()
public SettingsWindow()
{
InitializeComponent();
}

View File

@@ -1,22 +0,0 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="RedBookPlayer.ThemeSelectionWindow"
Title="Select Theme"
Width="450" Height="600">
<Border Padding="10">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<ListBox Grid.Row="0" Grid.Column="0" Name="ThemeList" SelectionMode="Single" Margin="0,0,0,16"/>
<Button Grid.Row="1" Grid.Column="0" Name="ApplyButton">Apply</Button>
</Grid>
</Border>
</Window>