111 lines
5.1 KiB
XML
111 lines
5.1 KiB
XML
<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"
|
|
xmlns:vm="using:GazpromApp.ViewModels"
|
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
|
Width="1436" Height="720"
|
|
x:Class="GazpromApp.Views.MainWindow"
|
|
x:DataType="vm:MainWindowViewModel"
|
|
Icon="/Assets/gazpromapp.ico"
|
|
Title="GazpromApp"
|
|
WindowStartupLocation="CenterScreen">
|
|
<Design.DataContext>
|
|
<!-- This only sets the DataContext for the previewer in an IDE,
|
|
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
|
<vm:MainWindowViewModel/>
|
|
</Design.DataContext>
|
|
<Window.Resources>
|
|
<ResourceDictionary>
|
|
<ResourceDictionary.ThemeDictionaries>
|
|
<ResourceDictionary x:Key="Light">
|
|
<SolidColorBrush x:Key="BackgroundBrush" Color="#f0f0f0"/>
|
|
<SolidColorBrush x:Key="BorderBrush" Color="#d3d3d3"/>
|
|
</ResourceDictionary>
|
|
<ResourceDictionary x:Key="Dark">
|
|
<!-- ReSharper disable once Xaml.RedundantResource -->
|
|
<SolidColorBrush x:Key="BackgroundBrush" Color="#101010"/>
|
|
<!-- ReSharper disable once Xaml.RedundantResource -->
|
|
<SolidColorBrush x:Key="BorderBrush" Color="#303030"/>
|
|
</ResourceDictionary>
|
|
</ResourceDictionary.ThemeDictionaries>
|
|
</ResourceDictionary>
|
|
</Window.Resources>
|
|
|
|
<DockPanel x:Name="Root">
|
|
<Menu DockPanel.Dock="Top">
|
|
<MenuItem Command="{Binding AddPointCommand}">
|
|
<MenuItem.Header>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Width="24" Height="24" Source="avares://GazpromApp/Assets/ic_fluent_home_add_24_filled (Custom).png"/>
|
|
<TextBlock Margin="8,0,0,0" Text="Добавить" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</MenuItem.Header>
|
|
</MenuItem>
|
|
<MenuItem>
|
|
<MenuItem.Header>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Width="24" Height="24" Source="avares://GazpromApp/Assets/ic_fluent_arrow_export_ltr_24_filled (Custom).png"/>
|
|
<TextBlock Margin="8,0,0,0" Text="Экспорт" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</MenuItem.Header>
|
|
</MenuItem>
|
|
<MenuItem>
|
|
<MenuItem.Header>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Width="24" Height="24" Source="avares://GazpromApp/Assets/ic_fluent_arrow_import_24_filled (Custom).png"/>
|
|
<TextBlock Margin="8,0,0,0" Text="Импорт" VerticalAlignment="Center"/>
|
|
</StackPanel>
|
|
</MenuItem.Header>
|
|
</MenuItem>
|
|
</Menu>
|
|
<Grid DockPanel.Dock="Top" HorizontalAlignment="Stretch"
|
|
ColumnDefinitions="*,*,100">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition MaxHeight="50"/>
|
|
</Grid.RowDefinitions>
|
|
<ScrollViewer Grid.ColumnSpan="3">
|
|
<StackPanel Orientation="Vertical">
|
|
<ItemsControl ItemsSource="{Binding Points}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate DataType="vm:PointViewModel">
|
|
<Border CornerRadius="4" BorderThickness="1" Margin="6"
|
|
Background="{DynamicResource BackgroundBrush}"
|
|
BorderBrush="{DynamicResource BorderBrush}">
|
|
<Grid Margin="6">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto" MaxWidth="300"/>
|
|
<ColumnDefinition />
|
|
<ColumnDefinition Width="Auto" />
|
|
<ColumnDefinition Width="Auto" />
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock FontSize="24" Margin="4" VerticalAlignment="Center"
|
|
Grid.Column="0"
|
|
Text="{Binding Name}"/>
|
|
<TextBlock Margin="4" VerticalAlignment="Center"
|
|
Grid.Column="1"
|
|
Text="{Binding Description}"/>
|
|
<Button Grid.Column="2"
|
|
Command="{Binding #Root.((vm:MainWindowViewModel)DataContext).EditPointCommand}"
|
|
CommandParameter="{Binding .}"
|
|
Margin="4">
|
|
<Image Source="avares://GazpromApp/Assets/ic_fluent_edit_24_filled (Custom).png"/>
|
|
</Button>
|
|
<Button Grid.Column="3"
|
|
Command="{Binding #Root.((vm:MainWindowViewModel)DataContext).RemovePointCommand}"
|
|
CommandParameter="{Binding .}"
|
|
Margin="4">
|
|
<Image Source="avares://GazpromApp/Assets/ic_fluent_delete_24_filled (Custom).png"/>
|
|
</Button>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</StackPanel>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</DockPanel>
|
|
</Window>
|