MenuPage.axaml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="440" d:DesignHeight="990"
  6. xmlns:vm="using:AvaloniaApplication4.ViewModels"
  7. x:DataType="vm:MainPageViewModel"
  8. Background="#B44A45"
  9. Padding="44"
  10. x:Class="AvaloniaApplication4.Views.MenuPage">
  11. <ScrollViewer>
  12. <StackPanel Orientation="Vertical">
  13. <StackPanel Orientation="Horizontal" Margin="0 0 0 75" HorizontalAlignment="Stretch">
  14. <Image Source="/Assets/Images/logoNGK.png" VerticalAlignment="Center" Height="94" Width="120"/>
  15. <TextBlock Margin="40 0 0 0" Text="Меню" VerticalAlignment="Center" Classes="titleStyleLight" FontWeight="Bold"/>
  16. </StackPanel>
  17. <TextBlock IsVisible="{Binding IsVisibleBase}" Margin="0 0 0 40" Text="Основные действия" Classes="mediumTextLight" FontWeight="Bold" FontSize="24"/>
  18. <ListBox Background="Transparent" IsVisible="{Binding IsVisibleBase}" ItemsSource="{Binding BasicActionsMenuElements}" Margin="0 0 0 70">
  19. <ListBox.ItemTemplate>
  20. <DataTemplate>
  21. <Button HorizontalAlignment="Stretch" Classes="menuElement" Content="{Binding NameElement}" Command="{Binding $parent[UserControl].((vm:MainPageViewModel)DataContext).SetActivePage}" CommandParameter="{Binding IdElement}" Margin="0 0 0 5"></Button>
  22. </DataTemplate>
  23. </ListBox.ItemTemplate>
  24. </ListBox>
  25. <TextBlock Margin="0 0 0 40" IsVisible="{Binding IsVisibleAdditional}" Text="Дополнительные действия" Classes="mediumTextLight" FontWeight="Bold" FontSize="24"/>
  26. <ListBox Background="Transparent" IsVisible="{Binding IsVisibleAdditional}" ItemsSource="{Binding AdditionalActionsMenuElements}">
  27. <ListBox.ItemTemplate>
  28. <DataTemplate>
  29. <Button HorizontalAlignment="Stretch" Classes="menuElement" Content="{Binding NameElement}" Command="{Binding $parent[UserControl].((vm:MainPageViewModel)DataContext).SetActivePage}" CommandParameter="{Binding IdElement}" Margin="0 0 0 5"></Button>
  30. </DataTemplate>
  31. </ListBox.ItemTemplate>
  32. </ListBox>
  33. <StackPanel Margin="0 100 0 0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  34. <Button HorizontalAlignment="Left" Command ="{Binding LogOut}">
  35. <Image Source="/Assets/Images/LogOut.png" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  36. </Button>
  37. <Button HorizontalAlignment="Right" Command="{Binding ToAccount}">
  38. <Image Source="/Assets/Images/Account.png" VerticalAlignment="Center" HorizontalAlignment="Center"/>
  39. </Button>
  40. </StackPanel>
  41. </StackPanel>
  42. </ScrollViewer>
  43. </UserControl>