FreeTubeSyncer/FreeTubeSyncer/MainWindow.axaml
Mario Steele b0ac6c1b7b Updated MainWindow
Updated MainWindow.xaml with UI controls for FreeTubeSyncer application
settings.

Updated MainWindow.xaml.cs code behind file top handle logic of not
closing the app when the window is closed, and handling Saving and
Hiding of the Window when close is requestd.
2025-07-31 03:34:31 -05:00

51 lines
2.8 KiB
XML

<suki:SukiWindow 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"
xmlns:suki="https://github.com/kikipoulet/SukiUI"
xmlns:vm="clr-namespace:FreeTubeSyncer.Models"
mc:Ignorable="d" d:DesignWidth="400" d:DesignHeight="345"
Width="400" Height="345"
x:Class="FreeTubeSyncer.MainWindow"
x:DataType="vm:AppSettings"
BackgroundStyle="GradientDarker"
CanResize="False"
CanMaximize="False"
Title="FreeTubeSyncer">
<StackPanel Orientation="Vertical" Margin="10" Spacing="5">
<Label Content="Settings" FontSize="24"/>
<Separator/>
<Grid
ColumnDefinitions="182,*"
RowDefinitions="*,*">
<TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Text="REST API Backend Server: " FontWeight="Bold"/>
<TextBox Grid.Row="0" Grid.Column="1" Watermark="http://localhost:8080" Text="{Binding RestBaseUrl, Mode=TwoWay}"/>
<TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Text="Refresh Interval: " FontWeight="Bold"/>
<NumericUpDown Grid.Row="1" Grid.Column="1" Watermark="30" suki:NumericUpDownExtensions.Unit="seconds" FormatString="N0" Value="{Binding CheckInterval, Mode=TwoWay}"/>
</Grid>
<Grid
ColumnDefinitions="170,*"
RowDefinitions="*,*,*">
<ToggleSwitch Grid.Row="0" Grid.Column="0" IsPressed="{Binding SyncHistory, Mode=TwoWay}" OnContent="Sync History" />
<ToggleSwitch Grid.Row="0" Grid.Column="1" IsPressed="{Binding SyncPlaylist, Mode=TwoWay}" OnContent="Sync Playlists"/>
<ToggleSwitch Grid.Row="1" Grid.Column="0" IsPressed="{Binding SyncProfile, Mode=TwoWay}" OnContent="Sync Profiles"/>
<ToggleSwitch Grid.Row="1" Grid.Column="1" IsPressed="{Binding SyncSearchHistory, Mode=TwoWay}" OnContent="Sync Search History"/>
<ToggleSwitch Grid.Row="2" Grid.Column="0" IsPressed="{Binding SyncSettings, Mode=TwoWay}" OnContent="Sync Settings"/>
</Grid>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Spacing="10">
<Button
IsEnabled="{Binding SettingsDirty}"
Classes="Flat Accent"
Click="SaveSettings_OnClick"
Content="Save"/>
<Button
IsEnabled="True"
Classes="Danger"
Click="CloseWindow_OnClick"
Content="Cancel"/>
</StackPanel>
</StackPanel>
</suki:SukiWindow>