<Window x:Class="Apollon.WPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        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:local="clr-namespace:Apollon.WPF" 
        xmlns:components="clr-namespace:Apollon.WPF.Views.Components"
        xmlns:views="clr-namespace:Apollon.WPF.Views"
        xmlns:vms="clr-namespace:Apollon.WPF.ViewModels" 
        xmlns:custom="clr-namespace:ModalControl;assembly=ModalControl"
        mc:Ignorable="d"
        Title="Apollon Auswertung Bogen"
        Height="680"
        Width="1100"
        WindowStartupLocation="CenterScreen"
        Background="Transparent"
        AllowsTransparency="True"
        WindowStyle="None"
        ResizeMode="NoResize"
        MouseDown="Window_MouseDown">
    <Window.Resources>
        <DataTemplate DataType="{x:Type vms:AddTournamentViewModel}">
            <views:AddTournamentView/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vms:EditTournamentViewModel}">
            <views:EditTournamentView/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vms:WarningDeleteViewModel}">
            <views:WarningDeleteView/>
        </DataTemplate>        
        <DataTemplate DataType="{x:Type vms:OverviewViewModel}">
            <views:OverviewView Content="{Binding CurrentViewModel}" DataContext="{Binding OverviewViewModel}"/>
        </DataTemplate>
        <DataTemplate DataType="{x:Type vms:AddEditDetailsViewModel}">
            <components:AddEditDetails/>
        </DataTemplate>
    </Window.Resources>    
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>

            <custom:Modal Grid.RowSpan="2" Panel.ZIndex="1" IsOpen="{Binding IsModalOpen}">
            
                <ContentControl Margin="30" Content="{Binding CurrentModalViewModel}"/>
            </custom:Modal>
      
        <views:Layout Grid.RowSpan="2"/>

        <ContentControl Content="{Binding CurrentViewModel}">
            <ContentControl.Resources>
                <DataTemplate DataType="{x:Type vms:OverviewViewModel}">
                    <views:OverviewView/>
                </DataTemplate>
                <DataTemplate DataType="{x:Type vms:TournamentDetailsViewModel}">
                    <views:TournamentDetailsView/>
                </DataTemplate>
                <DataTemplate DataType="{x:Type vms:RootdatesViewModel}">
                    <views:RootdatesView/>
                </DataTemplate>
            </ContentControl.Resources>
        </ContentControl>        

        <WrapPanel HorizontalAlignment="Right"
                       Margin="0 0 5 0">

                <Button Width="35"
                        Height="35"                    
                        Background="Transparent"
                        BorderBrush="Transparent"
                        Content="🗕"
                        FontSize="18"   
                        FontWeight="Bold"
                        Foreground="#0000a0"
                        Click="Button_Min"/>

                <Button Width="35"
                        Height="35"                    
                        Background="Transparent"
                        BorderBrush="Transparent"
                        Content="☐"
                        FontSize="18"   
                        FontWeight="Bold"
                        Foreground="#0000a0"
                        Click="Button_Max"/>
                
                <Button Width="35"
                        Height="35"                    
                        Background="Transparent"
                        BorderBrush="Transparent"
                        Content="🗙"
                        FontSize="18"   
                        Foreground="#0000a0"
                        Click="Button_Exit"/>
            </WrapPanel>
        </Grid>   
</Window>
