<Window x:Class="SmartAquaViewer.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:SmartAquaViewer"
        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        xmlns:view="clr-namespace:SmartAquaViewer.View"
        xmlns:vm="clr-namespace:SmartAquaViewer.ViewModel"
        xmlns:helper="clr-namespace:SmartAquaViewer.Helper"
        mc:Ignorable="d"
        Title="MainWindow" Height="1080" Width="1920" WindowStartupLocation="CenterScreen" Style="{StaticResource WindowChromeStyle}">

    <Window.DataContext>
        <vm:MainViewModel/>
    </Window.DataContext>
    
    <Grid>
        <Grid.Background>
            <ImageBrush ImageSource="./Resources/Images/background.png"></ImageBrush>
        </Grid.Background>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="270"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="48"/>
            <RowDefinition Height="92"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Border Grid.ColumnSpan="2" Background="#1D3649"
                BorderBrush="#325C80" BorderThickness="0 0 0 1">
            <Grid>
                <TextBlock x:Name="appTitle" Text="{Binding AppTitle}" FontFamily="{StaticResource SCDream6}"
                           Margin="20 0 0 0" Foreground="White" FontSize="16"
                           VerticalAlignment="Center"/>

                <Image Source="/Resources/Images/NIFS_logo_w.png"
                       HorizontalAlignment="Center" VerticalAlignment="Stretch"/>

                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center" WindowChrome.IsHitTestVisibleInChrome="True">
                    <Button Style="{StaticResource WindowChromeButtonStyle}" x:Name="windowMin" Content="━" Click="WindowMin_Click" FontSize="14" FontWeight="Bold"></Button>
                    <Button Style="{StaticResource WindowChromeButtonStyle}" x:Name="windowMax" Click="WindowMax_Click">
                        <StackPanel Orientation="Vertical">
                            <Image Source="./Resources/Images/max.png" Margin="12 10"></Image>
                        </StackPanel>
                    </Button>
                    <Button Style="{StaticResource WindowChromeButtonStyle}" x:Name="windowNormal" Click="WindowNormal_Click" Visibility="Collapsed">
                        <StackPanel Orientation="Vertical">
                            <Image Source="./Resources/Images/normal.png" Margin="12 10 12 5"></Image>
                        </StackPanel>
                    </Button>
                    <Button Style="{StaticResource WindowChromeButtonStyle}" x:Name="windowClose" Content="X" Click="WindowClose_Click" FontSize="14"></Button>
                </StackPanel>
            </Grid>
        </Border>

        <Grid Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2"
              Background="#152935"/>

        <view:FileListView Grid.Row="1" Grid.RowSpan="2" x:Name="fileListView"/>

        <Border Grid.Row="1" Grid.Column="1" Margin="16 12 16 0">
            <UniformGrid Columns="4">
                <RadioButton x:Name="rdbtnMonitoing" GroupName="contentSwap" Content="모니터링" Tag="monitoring"
                             Style="{StaticResource RadioButtonTabStyle}" IsChecked="True" FontSize="30"
                             helper:RadioButtonHelper.UnPressedImage="/Resources/Images/tab_bg_off.png"
                             helper:RadioButtonHelper.PressedImage="/Resources/Images/tab_bg.png"
                             Command="{Binding SwapViewCommand}"
                             CommandParameter="{Binding Tag, RelativeSource={RelativeSource Self}}"/>
                <RadioButton x:Name="rdbtnEnergy" GroupName="contentSwap" Content="에너지" Tag="energy"
                             Style="{StaticResource RadioButtonTabStyle}" Grid.Column="1" FontSize="30"
                             Command="{Binding SwapViewCommand}"
                             CommandParameter="{Binding Tag, RelativeSource={RelativeSource Self}}"/>
                <RadioButton x:Name="rdBtnGreenHouseGas" GroupName="contentSwap" Content="온실가스" Tag="greenHouseGas"
                             Style="{StaticResource RadioButtonTabStyle}" Grid.Column="2" FontSize="30"
                             Command="{Binding SwapViewCommand}"
                             CommandParameter="{Binding Tag, RelativeSource={RelativeSource Self}}"/>
                <RadioButton x:Name="rdbtnCCTV" GroupName="contentSwap" Content="CCTV" Tag="cctv"
                             Style="{StaticResource RadioButtonTabStyle}" Grid.Column="3" FontSize="30"
                             Command="{Binding SwapViewCommand}"
                             CommandParameter="{Binding Tag, RelativeSource={RelativeSource Self}}"/>
            </UniformGrid>
        </Border>

        <ContentControl x:Name="contentControl" Content="{Binding SelectedViewModel}"
                        Grid.Row="2" Grid.Column="1" Margin="30 16 30 12"/>
    </Grid>
</Window>
