<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.MainWindow"
        Icon="/Assets/avalonia-logo.ico"
        x:DataType="vm:MainWindowViewModel"
        Title="PSCHelpdesk"
        x:Name="MainWindowView">
        <Grid>
               <Grid RowDefinitions="Auto,*">
                        <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>
                        </Menu>
                        <TabControl Grid.Row="1" ItemsSource="{Binding TabItems}" SelectedItem="{Binding SelectedTabItem}">
                               <TabControl.ItemTemplate>
                                       <DataTemplate DataType="vm:TabItemViewModel">
                                               <TextBlock Text="{Binding Header}" />
                                       </DataTemplate>
                               </TabControl.ItemTemplate>
                               <TabControl.ContentTemplate>
                                       <DataTemplate DataType="vm:TabItemViewModel">
                                               <DockPanel>
                                                       <ContentControl Content="{Binding Content}" />
                                               </DockPanel>
                                       </DataTemplate>
                               </TabControl.ContentTemplate>
                        </TabControl>
               </Grid>
                
                <UserControl HorizontalAlignment="Right"
                             VerticalAlignment="Top"
                             Margin="0,0,0,0"
                             Content="{Binding ToastHolderManager}" />
       </Grid>
</Window>
