<Window x:Class="TimedShutdown.Views.ShellRootView"
        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"
        mc:Ignorable="d"
        Title="Timed Shutdown" Height="{Binding WindowHeight, Mode=TwoWay}" Width="400" WindowStartupLocation="CenterScreen"
        ResizeMode="NoResize">
    <StackPanel>
        <Grid x:Name="ShutdownIcon" Margin="15">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="0.5*"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            
            <!-- Icon -->
            <Image Source="/TimedShutdown;component/Resources/ShutdownIcon.png" Grid.Column="0" Grid.Row="0"
                   Margin="0,0,5,0"  Grid.RowSpan="5" RenderOptions.BitmapScalingMode="Fant"/>

            <!-- Row 1: Hours -->
            <Label Content="Hours:" Grid.Row="0" Grid.Column="1" />
            <Slider Value="{Binding Hours, Mode=TwoWay}" Grid.Row="0" Grid.Column="2"
                    Margin="10,0,10,0" Maximum="23" TickPlacement="BottomRight"/>
            <TextBox Text="{Binding Hours, Mode=TwoWay}" Grid.Row="0" Grid.Column="3"
                     Margin="0,2.5" Padding="5" />

            <!-- Row 2: Minutes -->
            <Label Content="Minutes:" Grid.Row="1" Grid.Column="1" />
            <Slider Value="{Binding Minutes, Mode=TwoWay}" Grid.Row="1" Grid.Column="2"
                    Margin="10,0,10,0" Maximum="59" TickPlacement="BottomRight"/>
            <TextBox Text="{Binding Minutes, Mode=TwoWay}" Grid.Row="1" Grid.Column="3"
                     Margin="0,2.5" Padding="5"/>

            <!-- Row 3: Options -->
            <Label Content="Options:" Grid.Row="2" Grid.Column="1" />
            <CheckBox x:Name="ShutdownOptionsForce" Content="Force Operation" Grid.Row="2" Grid.Column="2"
                      Margin="10,6,0,0" ToolTip="Forces a system shutdown/restart by ignoring programs preventing a shutdown."/>

            <!-- Row 4: Shutdown Time -->
            <Label Content="Shutdown Time:" Grid.Row="4" Grid.Column="1" Margin="0,5,0,0"/>
            <TextBox Text="{Binding ShutdownTimeSpan, Mode=OneWay}" Grid.Row="4" Grid.Column="2"
                     Grid.ColumnSpan="2"  Padding="5" Margin="10,5,0,0" IsEnabled="False"/>

        </Grid>

        <!-- Row 5: Shutdown/Reboot -->
        <Separator/>
        <Grid Margin="15">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <Button x:Name="Shutdown" Content="Shutdown" Grid.Row="0" Grid.Column="0"
                    Padding="5" Margin="0,5,2.5,0"/>
            <Button x:Name="Reboot" Content="Reboot"  Grid.Row="0" Grid.Column="1"
                    Padding="5" Margin="2.5,5,0,0"/>
            <Button x:Name="AbortShutdown" Content="Abort Shutdown"  Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
                    Padding="5" Margin="0,5,0,0"/>

        <!-- Remote Shutdown Options -->
        </Grid>
        <Separator/>
        <Expander IsExpanded="{Binding RemoteExpander}" x:Name="remoteExpander" Header="Remote Shutdown Options" Height="172"  Padding="5">
            
            <Grid>
                
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>

            <!-- Row 6: Hostname/IP-->
            <Label Content="Hostname/IP Address:" Grid.Row="0" Grid.Column="0" Margin="0,5,0,0"/>
                <TextBox Text="{Binding RemoteShutdown, Mode=TwoWay}" Grid.Row="0" Grid.Column="1"
                     Padding="5" Margin="10,5,5,0"
                     ToolTip="Enter the machine name or IP address to remotely shutdown. NOTE: This will only work on machines part of the same Windows Domain."/>
                
            <!-- Row 7: Ping remote host -->
            <Label Content="Options:" Grid.Row="1" Grid.Column="0"/>
                <CheckBox  IsChecked="{Binding PingRemoteHost, Mode=OneWayToSource}" Content="Ping remote host"
                           Grid.Row="1" Grid.Column="1" Margin="10,5,0,0"/>

            <!-- Row 8: Ping status -->
            <Label Content="Status:" Grid.Row="2" Grid.Column="0"/>
                <Label Content="{Binding PingRemoteHostStatus}" Grid.Row="2" Grid.Column="1"/>
                
            </Grid>
        </Expander>
    </StackPanel>
</Window>
