Files
community/Ink Canvas/Windows/CountdownTimerWindow.xaml
T
doudou0720 7a363f7f79 feat:支持交叉编译并完成iNKORE.UI.WPF.Modern升级 (#398)
* fix(deps):仅更新SimpleStackPanel

* feat:支持交叉编译并完成iNKORE.UI升级

* chore:fix com

* fix(Build/logic):在非.Net Framework MSBuild下使用预生成的互操作dll而非依据系统判断

Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com>

* feat:添加devcontainer.json

* chore(devcontainer.json):精简Dev Container

---------

Signed-off-by: doudou0720 <98651603+doudou0720@users.noreply.github.com>
2026-03-14 17:19:05 +08:00

250 lines
20 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<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:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:processbars="clr-namespace:Ink_Canvas.ProcessBars"
ui:ThemeManager.RequestedTheme="Light" Topmost="True" Background="Transparent"
mc:Ignorable="d" WindowStyle="None" AllowsTransparency="True"
ResizeMode="CanMinimize"
Loaded="Window_Loaded" Closing="Window_Closing" WindowStartupLocation="CenterScreen"
Title="Ink Canvas 画板 - 计时器" Height="700" Width="1100">
<Border Background="{DynamicResource TimerWindowBackground}" CornerRadius="10" BorderThickness="1" BorderBrush="{DynamicResource TimerWindowBorderBrush}" Margin="60">
<Grid>
<TextBlock x:Name="TbCurrentTime" MouseDown="BtnMinimal_OnMouseUp" Visibility="Collapsed" FontSize="56" FontWeight="Black" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource TimerWindowTextForeground}" />
<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"/>
<ikw: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="{DynamicResource TimerWindowTextForeground}"
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">
<ikw:SimpleStackPanel Spacing="2">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_1">
<TextBlock x:Name="HourPlus5Text" Text="∧∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click">
<TextBlock x:Name="HourPlus1Text" Text="∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ikw:SimpleStackPanel>
<ikw:SimpleStackPanel Spacing="2" VerticalAlignment="Bottom">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_2">
<TextBlock x:Name="HourMinus1Text" Text="" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_3">
<TextBlock x:Name="HourMinus5Text" Text="∨∨" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ikw: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="{DynamicResource TimerWindowTextForeground}"
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">
<ikw:SimpleStackPanel Spacing="2">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_5">
<TextBlock x:Name="MinutePlus5Text" Text="∧∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_4">
<TextBlock x:Name="MinutePlus1Text" Text="∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ikw:SimpleStackPanel>
<ikw:SimpleStackPanel Spacing="2" VerticalAlignment="Bottom">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_6">
<TextBlock x:Name="MinuteMinus1Text" Text="" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_7">
<TextBlock x:Name="MinuteMinus5Text" Text="∨∨" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ikw: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="{DynamicResource TimerWindowTextForeground}"
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">
<ikw:SimpleStackPanel Spacing="2">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_8">
<TextBlock x:Name="SecondPlus5Text" Text="∧∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_9">
<TextBlock x:Name="SecondPlus1Text" Text="∧" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ikw:SimpleStackPanel>
<ikw:SimpleStackPanel Spacing="2" VerticalAlignment="Bottom">
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_10">
<TextBlock x:Name="SecondMinus1Text" Text="" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_11">
<TextBlock x:Name="SecondMinus5Text" Text="∨∨" Margin="-10" FontSize="8" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Button>
</ikw:SimpleStackPanel>
</Grid>
</ikw:SimpleStackPanel>
<Border x:Name="BorderStopTime" Background="{DynamicResource TimerWindowStopTimeBackground}" Margin="0,23,0,0"
Height="18" CornerRadius="9"
VerticalAlignment="Center" HorizontalAlignment="Center">
<ikw:SimpleStackPanel Margin="6,0" Spacing="0" Orientation="Horizontal" HorizontalAlignment="Center">
<Image Margin="0,0,2,0" Source="{DynamicResource TimerWindowClockIcon}" RenderOptions.BitmapScalingMode="HighQuality" Height="10" Width="10"/>
<TextBlock Name="TextBlockStopTime" Text="12:30 PM" FontSize="9" VerticalAlignment="Center" Foreground="{DynamicResource TimerWindowStopTimeForeground}"/>
</ikw:SimpleStackPanel>
</Border>
<ikw: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="{DynamicResource TimerWindowPrimaryButtonBackground}" 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="{DynamicResource TimerWindowButtonBackground}" 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="{DynamicResource TimerWindowButtonForeground}"/>
</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>
</ikw:SimpleStackPanel>
</Grid>
</Viewbox>
<Viewbox Visibility="{Binding ElementName=BigViewController, Path=Visibility}" Margin="20,20,20,20" HorizontalAlignment="Right">
<ikw: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="{DynamicResource TimerWindowButtonBackground}" 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="{DynamicResource TimerWindowButtonForeground}"/>
</Viewbox>
</Border>
<Border x:Name="BtnFullscreen" MouseUp="BtnFullscreen_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
Margin="5"
Background="{DynamicResource TimerWindowButtonBackground}" 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="{DynamicResource TimerWindowButtonForeground}"/>
</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>
</ikw:SimpleStackPanel>
</Viewbox>
<MediaElement Visibility="Collapsed" HorizontalAlignment="Left" Height="100" VerticalAlignment="Top" Width="100"/>
</Grid>
</Border>
</Window>