<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="clr-namespace:PSCHelpdesk.ViewModels"
        xmlns:vs="clr-namespace:PSCHelpdesk.Shared.Menu;assembly=Shared"
        xmlns:views="clr-namespace:PSCHelpdesk.Views"
        xmlns:toasts="clr-namespace:PSCHelpdesk.Toasts."
        mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
        x:Class="PSCHelpdesk.Views.MainDockWindow"
        Icon="/Assets/avalonia-logo.ico"
        xmlns:np="https://np.com/visuals"
        x:DataType="vm:MainDockWindowViewModel"
        Title="PSCHelpdesk"
        x:Name="MainWindowView">
  <Design.DataContext><vm:MainDockWindowViewModel></vm:MainDockWindowViewModel></Design.DataContext>

  <Grid RowDefinitions="Auto, *"
        Margin="5">
    <Menu Grid.Row="0">
      <MenuItem Header="_File">
        <MenuItem Click="Settings_OnClick" Header="_Settings"/>
        <Separator/>
        <MenuItem Click="Exit_OnClick" Header="_Exit"/>
      </MenuItem>
      <MenuItem Header="_Module" ItemsSource="{Binding MenuItems}" Classes="SubItems">
        <MenuItem.Styles>
          <Style Selector="MenuItem.SubItems MenuItem" x:DataType="vs:Item">
            <Setter Property="Header" Value="{Binding Header  }"/>
            <Setter Property="ItemsSource" Value="{Binding Items}"/>
            <Setter Property="Command" Value="{Binding Command }"></Setter>
            <Setter Property="CommandParameter" Value="{Binding Header}"></Setter>
          </Style>
        </MenuItem.Styles>
      </MenuItem>
      <MenuItem Header="_Plugins" Command="{Binding OpenPlugins}"></MenuItem>
      <MenuItem Header="_SaveLayout" Command="{Binding SaveLayout}"></MenuItem>
      <MenuItem Header="_RestoreLayout" Command="{Binding LoadLayout}"></MenuItem>
    </Menu>
    <DockControl x:Name="Dock" Grid.Row="1" Layout="{Binding Layout}" Margin="4"/>
  </Grid>
</Window>
