112 lines
5.4 KiB
XML
112 lines
5.4 KiB
XML
<UserControl 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:vm="using:InternalSortMethods.ViewModels"
|
||
xmlns:controls="using:InternalSortMethods.Controls"
|
||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
|
||
x:Class="InternalSortMethods.Views.MainView"
|
||
x:DataType="vm:MainViewModel">
|
||
<Design.DataContext>
|
||
<vm:MainViewModel />
|
||
</Design.DataContext>
|
||
|
||
<UserControl.Resources>
|
||
<ControlTheme x:Key="GlassButton" TargetType="Button">
|
||
<Setter Property="Background" Value="#40666EF1"/>
|
||
<Setter Property="Foreground" Value="White"/>
|
||
<Setter Property="CornerRadius" Value="12"/>
|
||
<Setter Property="Padding" Value="16,12"/>
|
||
<Setter Property="FontSize" Value="14"/>
|
||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||
<Setter Property="MinHeight" Value="48"/>
|
||
<Setter Property="MinWidth" Value="80"/>
|
||
</ControlTheme>
|
||
</UserControl.Resources>
|
||
|
||
<Grid RowDefinitions="Auto,*,Auto">
|
||
<Border Grid.Row="0" Background="#20000000" CornerRadius="16" Margin="16,16,16,8" Padding="16">
|
||
<Grid RowDefinitions="Auto,Auto" ColumnDefinitions="*,*,Auto">
|
||
<StackPanel Grid.Row="0" Grid.Column="0" Spacing="12">
|
||
<TextBlock Text="Алгоритм сортировки" FontSize="12" Foreground="#AAFFFFFF"/>
|
||
<ComboBox ItemsSource="{Binding Algorithms}"
|
||
SelectedItem="{Binding SelectedAlgorithm}"
|
||
MinWidth="180" MinHeight="44"
|
||
HorizontalAlignment="Stretch">
|
||
<ComboBox.ItemTemplate>
|
||
<DataTemplate>
|
||
<TextBlock Text="{Binding NameRu}"/>
|
||
</DataTemplate>
|
||
</ComboBox.ItemTemplate>
|
||
</ComboBox>
|
||
</StackPanel>
|
||
|
||
<StackPanel Grid.Row="0" Grid.Column="1" Spacing="12" Margin="16,0">
|
||
<TextBlock Text="Размер массива" FontSize="12" Foreground="#AAFFFFFF"/>
|
||
<Grid ColumnDefinitions="*,Auto">
|
||
<Slider Grid.Column="0" Minimum="5" Maximum="50" Value="{Binding ArraySize}"
|
||
TickFrequency="5" IsSnapToTickEnabled="True" MinHeight="44"/>
|
||
<TextBlock Grid.Column="1" Text="{Binding ArraySize}" Width="30" Margin="8,0"
|
||
VerticalAlignment="Center" Foreground="White"/>
|
||
</Grid>
|
||
</StackPanel>
|
||
|
||
<Button Grid.Row="0" Grid.Column="2" Content="Новый массив"
|
||
Command="{Binding GenerateArrayCommand}"
|
||
Theme="{StaticResource GlassButton}"
|
||
VerticalAlignment="Bottom" MinWidth="120"/>
|
||
|
||
<StackPanel Grid.Row="1" Grid.ColumnSpan="3" Spacing="12" Margin="0,16,0,0">
|
||
<TextBlock Text="Скорость анимации" FontSize="12" Foreground="#AAFFFFFF"/>
|
||
<Grid ColumnDefinitions="*,Auto">
|
||
<Slider Grid.Column="0" Minimum="50" Maximum="1000" Value="{Binding AnimationSpeed}"
|
||
TickFrequency="50" IsSnapToTickEnabled="True" MinHeight="44"/>
|
||
<TextBlock Grid.Column="1" Text="{Binding AnimationSpeed, StringFormat={}{0:0}} мс" Width="50" Margin="8,0"
|
||
VerticalAlignment="Center" Foreground="White"/>
|
||
</Grid>
|
||
</StackPanel>
|
||
</Grid>
|
||
</Border>
|
||
|
||
<Border Grid.Row="1" Background="#15FFFFFF" CornerRadius="16" Margin="16,8" Padding="16">
|
||
<controls:ArrayVisualizer Items="{Binding ArrayItems}"/>
|
||
</Border>
|
||
|
||
<Border Grid.Row="2" Background="#20000000" CornerRadius="16" Margin="16,8,16,16" Padding="16">
|
||
<Grid RowDefinitions="Auto,Auto" ColumnDefinitions="*,*,*,*,*">
|
||
<TextBlock Grid.Row="0" Grid.ColumnSpan="5" Text="{Binding StatusText}"
|
||
FontSize="16" FontWeight="SemiBold" Foreground="White"
|
||
HorizontalAlignment="Center" Margin="0,0,0,16"/>
|
||
|
||
<Button Grid.Row="1" Grid.Column="0" Content="Старт"
|
||
Command="{Binding StartCommand}"
|
||
Theme="{StaticResource GlassButton}"
|
||
HorizontalAlignment="Stretch" Margin="0,0,8,0"/>
|
||
|
||
<Button Grid.Row="1" Grid.Column="1" Content="Пауза"
|
||
Command="{Binding PauseCommand}"
|
||
Theme="{StaticResource GlassButton}"
|
||
HorizontalAlignment="Stretch" Margin="0,0,8,0"/>
|
||
|
||
<Button Grid.Row="1" Grid.Column="2" Content="Шаг"
|
||
Command="{Binding StepForwardCommand}"
|
||
Theme="{StaticResource GlassButton}"
|
||
HorizontalAlignment="Stretch" Margin="0,0,8,0"/>
|
||
|
||
<Button Grid.Row="1" Grid.Column="3" Content="Сброс"
|
||
Command="{Binding ResetCommand}"
|
||
Theme="{StaticResource GlassButton}"
|
||
HorizontalAlignment="Stretch" Margin="0,0,8,0"/>
|
||
|
||
<StackPanel Grid.Row="1" Grid.Column="4" Orientation="Horizontal" HorizontalAlignment="Right">
|
||
<Ellipse Width="12" Height="12" Fill="#4ADE80" Margin="0,0,8,0"
|
||
IsVisible="{Binding IsComplete}"/>
|
||
<Ellipse Width="12" Height="12" Fill="#FFE66D" Margin="0,0,8,0"
|
||
IsVisible="{Binding IsPaused}"/>
|
||
<Ellipse Width="12" Height="12" Fill="#6366F1"
|
||
IsVisible="{Binding IsRunning}"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
</Border>
|
||
</Grid>
|
||
</UserControl> |