/
benzenergy
/
BenzConfig
Обзор
Документация
Войти
/
benzenergy
/
BenzConfig
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/MainWindow.xaml
338 строк
16 KB
benzenergy
Add files via upload
03 фев 2026, 11:01
Не верифицирован
03 фев 2026, 11:01
13f79ec
Код
Авторство
О чём код?
<Window x:Class="ver20.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="BenzConfig" Height="600" Width="700" WindowStyle="None" ResizeMode="CanMinimize" Background="#1B1B1B" WindowStartupLocation="CenterScreen" MouseLeftButtonDown="Window_MouseLeftButtonDown"> <Grid> <Grid> <Grid.RowDefinitions> <RowDefinition Height="35"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!-- Шапка --> <Border Grid.Row="0" Background="#202020"> <Grid> <!-- Логотип --> <Image Source="/Resource/header.png" Height="22" VerticalAlignment="Center" Margin="0,0,530, 0"/> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,0,0"> <!-- Кнопка свернуть окно --> <Button Width="35" Height="35" Background="Transparent" BorderThickness="0" Click="BtnMinimize_Click" Cursor="Hand"> <Button.Template> <ControlTemplate TargetType="Button"> <Grid x:Name="grid" Background="#01000000"> <Image Source="/Resource/tray.png" Width="12" Height="12" Stretch="Uniform"/> </Grid> <ControlTemplate.Triggers> <!-- Hover --> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="grid" Property="Background" Value="#333333"/> </Trigger> <!-- Pressed --> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="grid" Property="Background" Value="#555555"/> </Trigger> <!-- Disabled --> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="grid" Property="Background" Value="#222222"/> <Setter Property="Opacity" Value="0.5"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> <!-- Кнопка закрытия --> <Button Width="35" Height="35" Background="Transparent" BorderThickness="0" Click="BtnClose_Click" Cursor="Hand"> <Button.Template> <ControlTemplate TargetType="Button"> <Grid x:Name="grid" Background="Transparent"> <Image Source="/Resource/close.png" Width="12" Height="12" Stretch="Uniform"/> </Grid> <ControlTemplate.Triggers> <!-- Hover --> <Trigger Property="IsMouseOver" Value="True"> <Setter TargetName="grid" Property="Background" Value="#333333"/> </Trigger> <!-- Pressed --> <Trigger Property="IsPressed" Value="True"> <Setter TargetName="grid" Property="Background" Value="#555555"/> </Trigger> <!-- Disabled --> <Trigger Property="IsEnabled" Value="False"> <Setter TargetName="grid" Property="Background" Value="#222222"/> <Setter Property="Opacity" Value="0.5"/> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Button.Template> </Button> </StackPanel> </Grid> </Border> <!-- ОСНОВНОЙ КОНТЕНТ --> <Grid Grid.Row="1" Margin="10"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <!-- Ввод лето --> <StackPanel Grid.Row="0" Grid.Column="0" Margin="0,0,5,10"> <TextBlock Text="Летний пробег" FontFamily="/Assets/Fonts/Gilroy/#Gilroy" FontWeight="Regular" FontSize="12" Foreground="#BDBDBD" Margin="5,0,0,10"/> <TextBox x:Name="InputSummer" Style="{StaticResource TextBoxWaterMark}" Foreground="#BDBDBD" FontFamily="/Assets/Fonts/Gilroy/#Gilroy" FontWeight="Regular" Height="40" MaxLength="10" Margin="5,0,0,0" FontSize="14" VerticalContentAlignment="Center" PreviewTextInput="NumberOnly" CaretBrush="#777777"/> <Button x:Name="BtnSummer" Style="{StaticResource RoundedButtonStyle}" Content="Рассчитать" FontSize="16" FontFamily="/Assets/Fonts/Exo2/#Exo 2" FontWeight="Medium" Height="40" Margin="5,6,0,0" Click="BtnSummer_Click_1"> <TextBlock.Foreground> <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> <GradientStop Color="#7E20C1" Offset="0"/> <GradientStop Color="#FD2357" Offset="0.5"/> <GradientStop Color="#F08C33" Offset="1"/> </LinearGradientBrush> </TextBlock.Foreground> </Button> <Button x:Name="BtnGearSummer" Style="{StaticResource RoundedButtonStyle}" Content="Настройки" FontFamily="/Assets/Fonts/Exo2/#Exo 2" FontWeight="Regular" FontSize="16" Foreground="#777777" Height="40" Margin="5,6,0,0"/> </StackPanel> <!-- Ввод зима --> <StackPanel Grid.Row="0" Grid.Column="1" Margin="5,0,0,10"> <TextBlock Text="Зимний пробег" FontFamily="/Assets/Fonts/Gilroy/#Gilroy" FontWeight="Regular" FontSize="12" Foreground="#BDBDBD" Margin="0,0,0,10"/> <TextBox x:Name="InputWinter" Style="{StaticResource TextBoxWaterMark}" Height="40" MaxLength="10" Foreground="#BDBDBD" FontFamily="/Assets/Fonts/Gilroy/#Gilroy" FontWeight="Regular" Margin="0,0,5,0" FontSize="14" VerticalContentAlignment="Center" PreviewTextInput="NumberOnly" CaretBrush="#777777" TextChanged="InputWinter_TextChanged"/> <Button x:Name="BtnWinter" Style="{StaticResource RoundedButtonStyle}" Content="Рассчитать" FontSize="16" FontFamily="/Assets/Fonts/Exo2/#Exo 2" FontWeight="Medium" Height="40" Margin="0,6,5,0"> <TextBlock.Foreground> <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5"> <GradientStop Color="#7E20C1" Offset="0"/> <GradientStop Color="#FD2357" Offset="0.5"/> <GradientStop Color="#F08C33" Offset="1"/> </LinearGradientBrush> </TextBlock.Foreground> </Button> <Button x:Name="BtnGearWinter" Style="{StaticResource RoundedButtonStyle}" Content="Настройки" FontFamily="/Assets/Fonts/Exo2/#Exo 2" FontWeight="Regular" FontSize="16" Foreground="#777777" Height="40" Margin="0,6,5,0" Click="BtnGearWinter_Click"/> </StackPanel> <!-- Вывод лето --> <ScrollViewer Grid.Row="1" Grid.Column="0" Padding="5" VerticalScrollBarVisibility="Auto"> <TextBox x:Name="OutSummer" Style="{StaticResource TextBoxStyle}" Foreground="#BDBDBD" FontFamily="/Assets/Fonts/Exo2/#Exo 2" FontWeight="Regular" FontSize="14" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" Margin="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"> </TextBox> </ScrollViewer> <!-- Вывод зима --> <ScrollViewer Grid.Row="1" Grid.Column="1" Padding="5" VerticalScrollBarVisibility="Auto"> <TextBox x:Name="OutWinter" Style="{StaticResource TextBoxStyle}" Foreground="#BDBDBD" FontFamily="/Assets/Fonts/Exo2/#Exo 2" FontWeight="Regular" FontSize="14" IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True" Margin="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/> </ScrollViewer> <!-- О программе --> <Button Grid.Row="2" Grid.Column="1" x:Name="BtnAbout" Style="{StaticResource AboutButtonStyle}" Width="30" Height="30" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,10,5,5" ToolTip="О программе"> <Image Source="/Resource/info.png" Width="15" Height="15" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="Uniform"/> </Button> </Grid> </Grid> </Grid> </Window>