Visual fixes
This commit is contained in:
@@ -4,6 +4,7 @@ using CommunityToolkit.Mvvm.Input;
|
|||||||
using CommunityToolkit.Mvvm.Messaging;
|
using CommunityToolkit.Mvvm.Messaging;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using Avalonia.Controls;
|
||||||
using GazpromApp.Models;
|
using GazpromApp.Models;
|
||||||
|
|
||||||
namespace GazpromApp.ViewModels;
|
namespace GazpromApp.ViewModels;
|
||||||
@@ -42,4 +43,11 @@ public partial class MainWindowViewModel : ViewModelBase
|
|||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool _isLineVisible;
|
private bool _isLineVisible;
|
||||||
|
|
||||||
|
public MainWindowViewModel()
|
||||||
|
{
|
||||||
|
if (Design.IsDesignMode)
|
||||||
|
Points = [new PointViewModel(new Point()) { Name = "Name test", Description = "Description test" }];
|
||||||
|
else Points = [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
+31
-18
@@ -4,19 +4,31 @@
|
|||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
xmlns:vm="using:GazpromApp.ViewModels"
|
xmlns:vm="using:GazpromApp.ViewModels"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||||
Width="1424" Height="714"
|
Width="1436" Height="720"
|
||||||
x:Class="GazpromApp.Views.MainWindow"
|
x:Class="GazpromApp.Views.MainWindow"
|
||||||
x:DataType="vm:MainWindowViewModel"
|
x:DataType="vm:MainWindowViewModel"
|
||||||
Icon="/Assets/gazpromapp.ico"
|
Icon="/Assets/gazpromapp.ico"
|
||||||
Title="GazpromApp"
|
Title="GazpromApp"
|
||||||
WindowStartupLocation="CenterScreen"
|
WindowStartupLocation="CenterScreen">
|
||||||
>
|
|
||||||
|
|
||||||
<Design.DataContext>
|
<Design.DataContext>
|
||||||
<!-- This only sets the DataContext for the previewer in an IDE,
|
<!-- 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) -->
|
to set the actual DataContext for runtime, set the DataContext property in code (look at App.axaml.cs) -->
|
||||||
<vm:MainWindowViewModel/>
|
<vm:MainWindowViewModel/>
|
||||||
</Design.DataContext>
|
</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">
|
||||||
|
<SolidColorBrush x:Key="BackgroundBrush" Color="#101010"/>
|
||||||
|
<SolidColorBrush x:Key="BorderBrush" Color="#303030"/>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</ResourceDictionary.ThemeDictionaries>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</Window.Resources>
|
||||||
|
|
||||||
<DockPanel x:Name="Root">
|
<DockPanel x:Name="Root">
|
||||||
<Menu DockPanel.Dock="Top">
|
<Menu DockPanel.Dock="Top">
|
||||||
@@ -45,50 +57,51 @@
|
|||||||
</MenuItem.Header>
|
</MenuItem.Header>
|
||||||
</MenuItem>
|
</MenuItem>
|
||||||
</Menu>
|
</Menu>
|
||||||
<Grid DockPanel.Dock="Top" HorizontalAlignment="Stretch">
|
<Grid DockPanel.Dock="Top" HorizontalAlignment="Stretch"
|
||||||
|
ColumnDefinitions="*,*,100">
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
<RowDefinition MaxHeight="50"/>
|
<RowDefinition MaxHeight="50"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
<ColumnDefinition Width="100"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<ScrollViewer Grid.ColumnSpan="3">
|
<ScrollViewer Grid.ColumnSpan="3">
|
||||||
<StackPanel Orientation="Vertical">
|
<StackPanel Orientation="Vertical">
|
||||||
<ItemsControl ItemsSource="{Binding Points}">
|
<ItemsControl ItemsSource="{Binding Points}">
|
||||||
<ItemsControl.ItemTemplate>
|
<ItemsControl.ItemTemplate>
|
||||||
<DataTemplate DataType="vm:PointViewModel">
|
<DataTemplate DataType="vm:PointViewModel">
|
||||||
<Grid Margin="10,6,18,6" RowDefinitions="12, Auto">
|
<Border CornerRadius="4" BorderThickness="1" Margin="6"
|
||||||
|
Background="{DynamicResource BackgroundBrush}"
|
||||||
|
BorderBrush="{DynamicResource BorderBrush}">
|
||||||
|
<Grid Margin="6">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="Auto" MaxWidth="300"/>
|
<ColumnDefinition Width="Auto" MaxWidth="300"/>
|
||||||
<ColumnDefinition />
|
<ColumnDefinition />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
<ColumnDefinition Width="Auto" />
|
<ColumnDefinition Width="Auto" />
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Rectangle Margin="-2,0,-2,5" Grid.ColumnSpan="4" Height="1" Fill="Gray" Opacity="0.25" VerticalAlignment="Top"/>
|
<TextBlock FontSize="24" Margin="4" VerticalAlignment="Center"
|
||||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="{Binding Name}" FontSize="24" Margin="4" VerticalAlignment="Center"/>
|
Grid.Column="0"
|
||||||
<TextBlock Grid.Row="1" Grid.Column="1" Text="{Binding Description}" Margin="4" VerticalAlignment="Center"/>
|
Text="{Binding Name}"/>
|
||||||
<Button Grid.Row="1" Grid.Column="2"
|
<TextBlock Margin="4" VerticalAlignment="Center"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding Description}"/>
|
||||||
|
<Button Grid.Column="2"
|
||||||
Command="{Binding #Root.((vm:MainWindowViewModel)DataContext).EditPointCommand}"
|
Command="{Binding #Root.((vm:MainWindowViewModel)DataContext).EditPointCommand}"
|
||||||
CommandParameter="{Binding .}"
|
CommandParameter="{Binding .}"
|
||||||
Margin="4">
|
Margin="4">
|
||||||
<Image Source="avares://GazpromApp/Assets/ic_fluent_edit_24_filled (Custom).png"/>
|
<Image Source="avares://GazpromApp/Assets/ic_fluent_edit_24_filled (Custom).png"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Grid.Row="1" Grid.Column="3"
|
<Button Grid.Column="3"
|
||||||
Command="{Binding #Root.((vm:MainWindowViewModel)DataContext).RemovePointCommand}"
|
Command="{Binding #Root.((vm:MainWindowViewModel)DataContext).RemovePointCommand}"
|
||||||
CommandParameter="{Binding .}"
|
CommandParameter="{Binding .}"
|
||||||
Margin="4">
|
Margin="4">
|
||||||
<Image Source="avares://GazpromApp/Assets/ic_fluent_delete_24_filled (Custom).png"/>
|
<Image Source="avares://GazpromApp/Assets/ic_fluent_delete_24_filled (Custom).png"/>
|
||||||
</Button>
|
</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Border>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ItemsControl.ItemTemplate>
|
</ItemsControl.ItemTemplate>
|
||||||
</ItemsControl>
|
</ItemsControl>
|
||||||
<Rectangle IsVisible="{Binding IsLineVisible}" Margin="6,6,6,0" Height="1" Fill="Gray" Opacity="0.25"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
</Grid>
|
</Grid>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
|
|||||||
Binary file not shown.
@@ -13,7 +13,7 @@ using System.Reflection;
|
|||||||
[assembly: System.Reflection.AssemblyCompanyAttribute("GazpromApp")]
|
[assembly: System.Reflection.AssemblyCompanyAttribute("GazpromApp")]
|
||||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+725b6dc53998e3fe82d1e7e83d0312933ae96983")]
|
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+646f60e800da077d6f0e380695010dafc74187f1")]
|
||||||
[assembly: System.Reflection.AssemblyProductAttribute("GazpromApp")]
|
[assembly: System.Reflection.AssemblyProductAttribute("GazpromApp")]
|
||||||
[assembly: System.Reflection.AssemblyTitleAttribute("GazpromApp")]
|
[assembly: System.Reflection.AssemblyTitleAttribute("GazpromApp")]
|
||||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
327dd27f22ee4d496be5fbf4fc27c7f9dfbad856b482d896a83e82e336f0e4fd
|
d96ce4087b396be689d2265a12a73a6073c44823fe98e991f0bc173e827a4fb3
|
||||||
|
|||||||
Reference in New Issue
Block a user