<Window x:Class="Ink_Canvas.CountdownTimerWindow"
        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:Ink_Canvas"
        xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
        xmlns:processbars="clr-namespace:Ink_Canvas.ProcessBars"
        ui:ThemeManager.RequestedTheme="Light" Topmost="True" Background="Transparent"
        mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
        Loaded="Window_Loaded" Closing="Window_Closing" WindowStartupLocation="CenterScreen"
        Title="Ink Canvas 画板 - 计时器" Height="700" Width="1100">
    <Border Background="#F0F3F9" CornerRadius="10" BorderThickness="1" BorderBrush="#0066BF" Margin="60">
        <Grid>
            <TextBlock x:Name="TbCurrentTime" MouseDown="BtnMinimal_OnMouseUp" Visibility="Collapsed" FontSize="56" FontWeight="Black" HorizontalAlignment="Center" VerticalAlignment="Center" />
            <Border MouseMove="WindowDragMove" Visibility="{Binding ElementName=TbCurrentTime, Path=Visibility}" Width="64" Height="15" CornerRadius="8" Background="Gray" Margin="0,0,0,5" HorizontalAlignment="Center" VerticalAlignment="Bottom" />
            <Viewbox x:Name="BigViewController" Margin="20,20,20,20">
                <Grid Height="180" Width="200">
                    <processbars:CycleProcessBar x:Name="ProcessBarTime" CurrentValue="0" Width="150" VerticalAlignment="Top"/>
                    <ui:SimpleStackPanel MouseMove="WindowDragMove" Orientation="Horizontal" Height="28.5" Margin="0,0,0,25"
                                         VerticalAlignment="Center"
                                         HorizontalAlignment="Center">
                        <TextBlock Name="TextBlockHour" FontFamily="Segeo UI"
                                   Margin="0,0,0,0" Visibility="Collapsed"
                                   Foreground="#5B5D5F"
                                   Text="00" FontSize="26"/>
                        <ItemsControl Name="TextControlHour" ItemsSource="{Binding ElementName=TextBlockHour, Path=Text}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Grid Width="14">
                                        <TextBlock Text="{Binding}" HorizontalAlignment="Center" FontWeight="SemiBold"
                                                   Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
                                                   FontFamily="{Binding ElementName=TextBlockHour, Path=FontFamily}"
                                                   FontSize="{Binding ElementName=TextBlockHour, Path=FontSize}"/>
                                    </Grid>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                        <Grid Name="GridAdjustHour" Visibility="Visible" Margin="-29,-30,0,-30" Width="29">
                            <ui:SimpleStackPanel Spacing="2">
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_1">
                                    <TextBlock Text="+5" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click">
                                    <TextBlock Text="+1" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                            </ui:SimpleStackPanel>
                            <ui:SimpleStackPanel Spacing="2" VerticalAlignment="Bottom">
                                <Button  Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_2">
                                    <TextBlock Text="-1" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_3">
                                    <TextBlock Text="-5" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                            </ui:SimpleStackPanel>
                        </Grid>
                        <TextBlock Text=":"
                                   FontFamily="{Binding ElementName=TextBlockHour, Path=FontFamily}"
                                   Margin="0,-2.5,0,0"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Top"
                                   Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
                                   FontSize="{Binding ElementName=TextBlockHour, Path=FontSize}"
                                   FontWeight="DemiBold"/>
                        <TextBlock Name="TextBlockMinute" FontFamily="{Binding ElementName=TextBlockHour, Path=FontFamily}"
                                   Margin="0,0,0,0" Visibility="Collapsed"
                                   Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
                                   Text="01" FontSize="26"/>
                        <ItemsControl Name="TextControlMinute" ItemsSource="{Binding ElementName=TextBlockMinute, Path=Text}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Grid Width="14">
                                        <TextBlock Text="{Binding}" HorizontalAlignment="Center" FontWeight="SemiBold"
                                                   Foreground="{Binding ElementName=TextBlockMinute, Path=Foreground}"
                                                   FontFamily="{Binding ElementName=TextBlockMinute, Path=FontFamily}"
                                                   FontSize="{Binding ElementName=TextBlockMinute, Path=FontSize}"/>
                                    </Grid>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                        <Grid Visibility="{Binding ElementName=GridAdjustHour, Path=Visibility}" Margin="-29,-30,0,-30" Width="29">
                            <ui:SimpleStackPanel Spacing="2">
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_5">
                                    <TextBlock Text="+5" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_4">
                                    <TextBlock Text="+1" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                            </ui:SimpleStackPanel>
                            <ui:SimpleStackPanel Spacing="2" VerticalAlignment="Bottom">
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_6">
                                    <TextBlock Text="-1" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_7">
                                    <TextBlock Text="-5" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                            </ui:SimpleStackPanel>
                            <Border x:Name="BtnTimeSetOkay" MouseUp="Grid_MouseUp"
                                    Background="#0066BF"
                                    Height="20" Width="20"
                                    CornerRadius="100"
                                    VerticalAlignment="Bottom" Margin="0,0,0,-35">
                                <Border.Effect>
                                    <DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
                                </Border.Effect>
                                <Viewbox Margin="5.5">
                                    <ui:SymbolIcon Symbol="Save" Foreground="White"/>
                                </Viewbox>
                            </Border>
                        </Grid>
                        <TextBlock Text=":"
                                   FontFamily="{Binding ElementName=TextBlockHour, Path=FontFamily}"
                                   Margin="0,-2.5,0,0"
                                   HorizontalAlignment="Center"
                                   VerticalAlignment="Top"
                                   Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
                                   FontSize="{Binding ElementName=TextBlockHour, Path=FontSize}"
                                   FontWeight="DemiBold"/>
                        <TextBlock Name="TextBlockSecond" FontFamily="{Binding ElementName=TextBlockHour, Path=FontFamily}"
                                   Margin="0,0,0,0" Visibility="Collapsed"
                                   Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
                                   Text="00" FontSize="26"/>
                        <ItemsControl Name="TextControlSecond" ItemsSource="{Binding ElementName=TextBlockSecond, Path=Text}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Grid Width="14">
                                        <TextBlock Text="{Binding}" HorizontalAlignment="Center" FontWeight="SemiBold"
                                               Foreground="{Binding ElementName=TextBlockSecond, Path=Foreground}"
                                               FontFamily="{Binding ElementName=TextBlockSecond, Path=FontFamily}"
                                               FontSize="{Binding ElementName=TextBlockSecond, Path=FontSize}"/>
                                    </Grid>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                        <Grid Margin="-96.8,0,0,0" Width="96.8" Background="Transparent" MouseUp="Grid_MouseUp"/>
                        <Grid Visibility="{Binding ElementName=GridAdjustHour, Path=Visibility}" Margin="-29,-30,0,-30" Width="29">
                            <ui:SimpleStackPanel Spacing="2">
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_8">
                                    <TextBlock Text="+5" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_9">
                                    <TextBlock Text="+1" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                            </ui:SimpleStackPanel>
                            <ui:SimpleStackPanel Spacing="2" VerticalAlignment="Bottom">
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_10">
                                    <TextBlock Text="-1" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                                <Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_11">
                                    <TextBlock Text="-5" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                </Button>
                            </ui:SimpleStackPanel>
                        </Grid>
                    </ui:SimpleStackPanel>
                    <Border x:Name="BorderStopTime" Background="#E8EAF0" Margin="0,23,0,0"
                            Height="18" CornerRadius="9"
                            VerticalAlignment="Center" HorizontalAlignment="Center">
                        <ui:SimpleStackPanel Margin="6,0" Spacing="0" Orientation="Horizontal" HorizontalAlignment="Center">
                            <Image Margin="0,0,2,0" Source="/Resources/Icons-Fluent/ic_fluent_clock_24_regular.png" RenderOptions.BitmapScalingMode="HighQuality" Height="10" Width="10"/>
                            <TextBlock Name="TextBlockStopTime" Text="12:30 PM" FontSize="9" VerticalAlignment="Center"/>
                        </ui:SimpleStackPanel>
                    </Border>
                    <ui:SimpleStackPanel Visibility="{Binding ElementName=ProcessBarTime, Path=Visibility}" Spacing="10" Orientation="Horizontal" Height="30" HorizontalAlignment="Center" VerticalAlignment="Bottom">
                        <Grid>
                            <Border x:Name="BtnStart" MouseUp="BtnStart_MouseUp" Background="#0066BF" Height="20" Width="20" CornerRadius="100">
                                <Viewbox Margin="5">
                                    <ui:SymbolIcon Name="SymbolIconStart" Symbol="Play" Foreground="White"/>
                                </Viewbox>
                            </Border>
                            <Border x:Name="BtnStartCover" Visibility="Collapsed" Background="#BFBFBF" Height="20" Width="20" CornerRadius="100">
                                <Viewbox Margin="5">
                                    <ui:SymbolIcon Symbol="{Binding ElementName=SymbolIconStart, Path=Symbol}" Foreground="White"/>
                                </Viewbox>
                            </Border>
                        </Grid>
                        <Grid>
                            <Border x:Name="BtnReset" MouseUp="BtnReset_MouseUp" Background="#FBFBFD" Height="20" Width="20" CornerRadius="100">
                                <Border.Effect>
                                    <DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.15" BlurRadius="3"/>
                                </Border.Effect>
                                <Viewbox Margin="5.5">
                                    <ui:SymbolIcon Symbol="Refresh" Foreground="Black"/>
                                </Viewbox>
                            </Border>
                            <Border x:Name="BtnResetCover" Background="#F3F5F9" Height="20" Width="20" CornerRadius="100">
                                <Viewbox Margin="5.5">
                                    <ui:SymbolIcon Symbol="Refresh" Foreground="#9D9D9E"/>
                                </Viewbox>
                            </Border>
                        </Grid>
                    </ui:SimpleStackPanel>
                </Grid>
            </Viewbox>
            <Viewbox Visibility="{Binding ElementName=BigViewController, Path=Visibility}" Margin="20,20,20,20" HorizontalAlignment="Right">
                <ui:SimpleStackPanel Height="180" Orientation="Horizontal">
                    <Border x:Name="BtnMinimal" Visibility="{Binding ElementName=BorderStopTime, Path=Visibility}" MouseUp="BtnMinimal_OnMouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
                            Margin="5"
                            Background="#FBFBFD" Height="20" Width="20" CornerRadius="100">
                        <Border.Effect>
                            <DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
                        </Border.Effect>
                        <Viewbox Margin="5.5">
                            <ui:SymbolIcon Name="SymbolIconMinimal" Symbol="HideBcc" Foreground="Black"/>
                        </Viewbox>
                    </Border>
                    <Border x:Name="BtnFullscreen" MouseUp="BtnFullscreen_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
                            Margin="5"
                            Background="#FBFBFD" Height="20" Width="20" CornerRadius="100">
                        <Border.Effect>
                            <DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
                        </Border.Effect>
                        <Viewbox Margin="5.5">
                            <ui:SymbolIcon Name="SymbolIconFullscreen" Symbol="FullScreen" Foreground="Black"/>
                        </Viewbox>
                    </Border>
                    <Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
                        Margin="5"
                        Background="#E32A34" Height="20" Width="20" CornerRadius="100">
                        <Border.Effect>
                            <DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
                        </Border.Effect>
                        <Viewbox Margin="5.5">
                            <ui:SymbolIcon Symbol="Clear"  Foreground="White"/>
                        </Viewbox>
                    </Border>
                </ui:SimpleStackPanel>
            </Viewbox>
            <MediaElement  Visibility="Collapsed" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100"/>
        </Grid>
    </Border>
</Window>
