Adding point works
This commit is contained in:
+76
-9
@@ -1,20 +1,87 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:GazpromApp.ViewModels"
|
||||
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"
|
||||
x:Class="GazpromApp.Views.MainWindow"
|
||||
x:DataType="vm:MainWindowViewModel"
|
||||
Icon="/Assets/avalonia-logo.ico"
|
||||
Title="GazpromApp">
|
||||
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>
|
||||
|
||||
<TextBlock Text="{Binding Greeting}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<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>
|
||||
|
||||
<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">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition MaxHeight="50"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="100"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<ScrollViewer Grid.ColumnSpan="3">
|
||||
<StackPanel Orientation="Vertical">
|
||||
<ItemsControl ItemsSource="{Binding Points}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate DataType="vm:PointViewModel">
|
||||
<Grid ColumnDefinitions="200, *, Auto, Auto" Margin="10,6,18,6" RowDefinitions="12, Auto">
|
||||
<Rectangle Margin="-2,0,-2,5" Grid.ColumnSpan="4" Height="1" Fill="Gray" Opacity="0.25" VerticalAlignment="Top"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Name}" FontSize="24" Margin="4" VerticalAlignment="Center"/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Description}" Margin="4" VerticalAlignment="Center"/>
|
||||
<Button Grid.Row="1" 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.Row="1" 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>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
<Rectangle IsVisible="{Binding IsLineVisible}" Margin="6,6,6,0" Height="1" Fill="Gray" Opacity="0.25"/>
|
||||
</StackPanel>
|
||||
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
|
||||
Reference in New Issue
Block a user