<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Cloud API PowerShell Management"
    WindowStartupLocation="CenterScreen"    
    x:Name="Window">
    
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Themes\Default.xaml" /> 
            </ResourceDictionary.MergedDictionaries>            
        </ResourceDictionary>
    </Window.Resources>

    <Grid x:Name="Grid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <Grid x:Name="grdMenu" Grid.ColumnSpan="2" VerticalAlignment="Top">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="5"/>
            </Grid.ColumnDefinitions>

            <Menu Name="mnuMain" Padding="0,5,0,5" Grid.ColumnSpan="1" >
                <MenuItem Header="_File" Name="mnuFile">  
                    <MenuItem Header="_Settings" Name="mnuSettings" />  
                    <MenuItem Header="_Tenant Settings" Name="mnuTenantSettings" />  
                    <Separator />
                    <MenuItem Header="_Release Notes" Name="mnuUpdates" />  
                    <MenuItem Header="_About" Name="mnuAbout" />
                    <Separator />
                    <MenuItem Header="_Exit" Name="mnuExit" />  
                </MenuItem> 
                <MenuItem Name="mnuViews" Header="_Views" >
                </MenuItem> 
            </Menu>

            <Grid x:Name="grdEnvironment" Visibility="Collapsed" Grid.Column="1">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <Label Content="" Name="lblEnvironment" FontWeight="Bold" Margin="5,0,5,0" />
            </Grid>                
        </Grid>

        <Grid Name="grdViewPanel" Grid.Column="1" Grid.RowSpan="2" Grid.Row="1" Margin="0,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />

        <Grid Grid.Row="1" Margin="5" VerticalAlignment="Stretch" Name="grdViewItemMenu">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>        
            <Label Content="" Name="lblMenuTitle" FontWeight="Bold" Margin="0,0,0,5" Background="{DynamicResource TitleBackgroundColor}" />
            <ListBox Grid.Row="1" Name="lstMenuItems" SelectionMode="Single" Grid.IsSharedSizeScope='True' Background="#e9e9e9" > <!-- ItemContainerStyle="{DynamicResource MainList}" -->
                <ListBox.ItemTemplate>                
                    <DataTemplate>                    
                        <Grid > <!-- Margin="0,0,0,0" -->
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto" SharedSizeGroup="ImageColumn" />
                                <ColumnDefinition Width="Auto" SharedSizeGroup="TitleColumn" />                                
                            </Grid.ColumnDefinitions> 
                            <ContentControl Content="{Binding IconImage}" Width="16" Height="16" Margin="0,0,5,0" />
                            <TextBlock Text="{Binding Title}" Grid.Column="1"/>
                        </Grid>  
                    </DataTemplate>  
                </ListBox.ItemTemplate>
                <ListBox.Resources>
                    <Style TargetType="ListBoxItem">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding @AccessType}" Value="None">
                                <Setter Property="Foreground" Value="Red" />
                            </DataTrigger>
                            <DataTrigger Binding="{Binding @AccessType}" Value="Limited">
                                <Setter Property="Foreground" Value="Orange" />
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </ListBox.Resources>
            </ListBox>
        </Grid>        

        <!-- Popup with no background e.g. drop down menu  -->
        <Grid Name="grdPopup" Grid.ColumnSpan="2" Grid.RowSpan="4" Visibility="Collapsed">
            <Grid.Background>
                <SolidColorBrush Opacity="0" />
            </Grid.Background>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
                <Canvas Name="cvsPopup" />
        </Grid>

        <!-- Modal popup with background  -->
        <Grid Name="grdModal" Grid.ColumnSpan="2" Grid.RowSpan="4" Visibility="Collapsed">
            <Grid.Background>
                <SolidColorBrush Opacity="0.5" Color="Black"/>
            </Grid.Background>
            <Grid.RowDefinitions>
                <RowDefinition Height="1*"/>
                <RowDefinition Height="15*"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="15*"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>
        </Grid>
        
        <Grid Name="grdStatus" Grid.ColumnSpan="2" Grid.RowSpan="4" Visibility="Collapsed">
            <Grid.Background>
                <SolidColorBrush Opacity="0.5" Color="Black" />
            </Grid.Background>
            <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
            <Label Name="txtInfo" Content="" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource TitleBackgroundColor}" />
        </Grid>

    </Grid>
</Window>