improve:按钮显示
This commit is contained in:
@@ -12,14 +12,7 @@
|
|||||||
Title="Ink Canvas 画板 - 计时器" Height="700" Width="1100">
|
Title="Ink Canvas 画板 - 计时器" Height="700" Width="1100">
|
||||||
<Border Background="#F0F3F9" CornerRadius="10" BorderThickness="1" BorderBrush="#0066BF" Margin="60">
|
<Border Background="#F0F3F9" CornerRadius="10" BorderThickness="1" BorderBrush="#0066BF" Margin="60">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBlock x:Name="TbCurrentTime" MouseDown="BtnMinimal_OnMouseUp" Visibility="Collapsed" FontSize="56" FontWeight="Black" HorizontalAlignment="Center" VerticalAlignment="Center" Text="00:00:00">
|
<TextBlock x:Name="TbCurrentTime" MouseDown="BtnMinimal_OnMouseUp" Visibility="Collapsed" FontSize="56" FontWeight="Black" HorizontalAlignment="Center" VerticalAlignment="Center" />
|
||||||
<TextBlock.Style>
|
|
||||||
<Style TargetType="TextBlock" BasedOn="{x:Null}">
|
|
||||||
<Setter Property="TextWrapping" Value="NoWrap" />
|
|
||||||
<Setter Property="TextTrimming" Value="None" />
|
|
||||||
</Style>
|
|
||||||
</TextBlock.Style>
|
|
||||||
</TextBlock>
|
|
||||||
<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" />
|
<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">
|
<Viewbox x:Name="BigViewController" Margin="20,20,20,20">
|
||||||
<Grid Height="180" Width="200">
|
<Grid Height="180" Width="200">
|
||||||
@@ -31,11 +24,23 @@
|
|||||||
Margin="0,0,0,0" Visibility="Collapsed"
|
Margin="0,0,0,0" Visibility="Collapsed"
|
||||||
Foreground="#5B5D5F"
|
Foreground="#5B5D5F"
|
||||||
Text="00" FontSize="26"/>
|
Text="00" FontSize="26"/>
|
||||||
<TextBlock Name="TextControlHour" Text="{Binding ElementName=TextBlockHour, Path=Text}"
|
<ItemsControl Name="TextControlHour" ItemsSource="{Binding ElementName=TextBlockHour, Path=Text}">
|
||||||
FontFamily="{Binding ElementName=TextBlockHour, Path=FontFamily}"
|
<ItemsControl.ItemsPanel>
|
||||||
Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
|
<ItemsPanelTemplate>
|
||||||
FontSize="{Binding ElementName=TextBlockHour, Path=FontSize}"
|
<StackPanel Orientation="Horizontal" />
|
||||||
FontWeight="SemiBold" HorizontalAlignment="Center"/>
|
</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">
|
<Grid Name="GridAdjustHour" Visibility="Visible" Margin="-29,-30,0,-30" Width="29">
|
||||||
<ui:SimpleStackPanel Spacing="2">
|
<ui:SimpleStackPanel Spacing="2">
|
||||||
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_1">
|
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_1">
|
||||||
@@ -66,11 +71,23 @@
|
|||||||
Margin="0,0,0,0" Visibility="Collapsed"
|
Margin="0,0,0,0" Visibility="Collapsed"
|
||||||
Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
|
Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
|
||||||
Text="01" FontSize="26"/>
|
Text="01" FontSize="26"/>
|
||||||
<TextBlock Name="TextControlMinute" Text="{Binding ElementName=TextBlockMinute, Path=Text}"
|
<ItemsControl Name="TextControlMinute" ItemsSource="{Binding ElementName=TextBlockMinute, Path=Text}">
|
||||||
FontFamily="{Binding ElementName=TextBlockMinute, Path=FontFamily}"
|
<ItemsControl.ItemsPanel>
|
||||||
Foreground="{Binding ElementName=TextBlockMinute, Path=Foreground}"
|
<ItemsPanelTemplate>
|
||||||
FontSize="{Binding ElementName=TextBlockMinute, Path=FontSize}"
|
<StackPanel Orientation="Horizontal" />
|
||||||
FontWeight="SemiBold" HorizontalAlignment="Center"/>
|
</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">
|
<Grid Visibility="{Binding ElementName=GridAdjustHour, Path=Visibility}" Margin="-29,-30,0,-30" Width="29">
|
||||||
<ui:SimpleStackPanel Spacing="2">
|
<ui:SimpleStackPanel Spacing="2">
|
||||||
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_5">
|
<Button Height="13" Width="{Binding ElementName=GridAdjustHour, Path=ActualWidth}" Click="Button_Click_5">
|
||||||
@@ -113,11 +130,23 @@
|
|||||||
Margin="0,0,0,0" Visibility="Collapsed"
|
Margin="0,0,0,0" Visibility="Collapsed"
|
||||||
Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
|
Foreground="{Binding ElementName=TextBlockHour, Path=Foreground}"
|
||||||
Text="00" FontSize="26"/>
|
Text="00" FontSize="26"/>
|
||||||
<TextBlock Name="TextControlSecond" Text="{Binding ElementName=TextBlockSecond, Path=Text}"
|
<ItemsControl Name="TextControlSecond" ItemsSource="{Binding ElementName=TextBlockSecond, Path=Text}">
|
||||||
FontFamily="{Binding ElementName=TextBlockSecond, Path=FontFamily}"
|
<ItemsControl.ItemsPanel>
|
||||||
Foreground="{Binding ElementName=TextBlockSecond, Path=Foreground}"
|
<ItemsPanelTemplate>
|
||||||
FontSize="{Binding ElementName=TextBlockSecond, Path=FontSize}"
|
<StackPanel Orientation="Horizontal" />
|
||||||
FontWeight="SemiBold" HorizontalAlignment="Center"/>
|
</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 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">
|
<Grid Visibility="{Binding ElementName=GridAdjustHour, Path=Visibility}" Margin="-29,-30,0,-30" Width="29">
|
||||||
<ui:SimpleStackPanel Spacing="2">
|
<ui:SimpleStackPanel Spacing="2">
|
||||||
@@ -150,12 +179,12 @@
|
|||||||
<Grid>
|
<Grid>
|
||||||
<Border x:Name="BtnStart" MouseUp="BtnStart_MouseUp" Background="#0066BF" Height="20" Width="20" CornerRadius="100">
|
<Border x:Name="BtnStart" MouseUp="BtnStart_MouseUp" Background="#0066BF" Height="20" Width="20" CornerRadius="100">
|
||||||
<Viewbox Margin="5">
|
<Viewbox Margin="5">
|
||||||
<ui:FontIcon Name="FontIconStart" Glyph="" Foreground="White"/>
|
<ui:SymbolIcon Name="SymbolIconStart" Symbol="Play" Foreground="White"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Border>
|
</Border>
|
||||||
<Border x:Name="BtnStartCover" Visibility="Collapsed" Background="#BFBFBF" Height="20" Width="20" CornerRadius="100">
|
<Border x:Name="BtnStartCover" Visibility="Collapsed" Background="#BFBFBF" Height="20" Width="20" CornerRadius="100">
|
||||||
<Viewbox Margin="5">
|
<Viewbox Margin="5">
|
||||||
<ui:FontIcon Glyph="{Binding ElementName=FontIconStart, Path=Glyph}" Foreground="White"/>
|
<ui:SymbolIcon Symbol="{Binding ElementName=SymbolIconStart, Path=Symbol}" Foreground="White"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -165,12 +194,12 @@
|
|||||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.15" BlurRadius="3"/>
|
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.15" BlurRadius="3"/>
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Viewbox Margin="5.5">
|
<Viewbox Margin="5.5">
|
||||||
<ui:FontIcon Glyph="" Foreground="Black"/>
|
<ui:SymbolIcon Symbol="Refresh" Foreground="Black"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Border>
|
</Border>
|
||||||
<Border x:Name="BtnResetCover" Background="#F3F5F9" Height="20" Width="20" CornerRadius="100">
|
<Border x:Name="BtnResetCover" Background="#F3F5F9" Height="20" Width="20" CornerRadius="100">
|
||||||
<Viewbox Margin="5.5">
|
<Viewbox Margin="5.5">
|
||||||
<ui:FontIcon Glyph="" Foreground="#9D9D9E"/>
|
<ui:SymbolIcon Symbol="Refresh" Foreground="#9D9D9E"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
@@ -186,7 +215,7 @@
|
|||||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Viewbox Margin="5.5">
|
<Viewbox Margin="5.5">
|
||||||
<TextBlock Name="FontIconMinimal" Text="" Foreground="Black" FontFamily="Segoe MDL2 Assets" FontSize="12" />
|
<ui:SymbolIcon Name="SymbolIconMinimal" Symbol="HideBcc" Foreground="Black"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Border>
|
</Border>
|
||||||
<Border x:Name="BtnFullscreen" MouseUp="BtnFullscreen_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
<Border x:Name="BtnFullscreen" MouseUp="BtnFullscreen_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||||
@@ -196,7 +225,7 @@
|
|||||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Viewbox Margin="5.5">
|
<Viewbox Margin="5.5">
|
||||||
<TextBlock Name="FontIconFullscreen" Text="" Foreground="Black" FontFamily="Segoe MDL2 Assets" FontSize="12" />
|
<ui:SymbolIcon Name="SymbolIconFullscreen" Symbol="FullScreen" Foreground="Black"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Border>
|
</Border>
|
||||||
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||||
@@ -206,7 +235,7 @@
|
|||||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Viewbox Margin="5.5">
|
<Viewbox Margin="5.5">
|
||||||
<TextBlock Text="" Foreground="White" FontFamily="Segoe MDL2 Assets" FontSize="12" />
|
<ui:SymbolIcon Symbol="Clear" Foreground="White"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Border>
|
</Border>
|
||||||
</ui:SimpleStackPanel>
|
</ui:SimpleStackPanel>
|
||||||
|
|||||||
@@ -1,16 +1,11 @@
|
|||||||
using Ink_Canvas.Helpers;
|
using Ink_Canvas.Helpers;
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
|
||||||
using System.Media;
|
using System.Media;
|
||||||
using System.Timers;
|
using System.Timers;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Application = System.Windows.Application;
|
|
||||||
using MouseEventArgs = System.Windows.Input.MouseEventArgs;
|
|
||||||
using Timer = System.Timers.Timer;
|
|
||||||
|
|
||||||
namespace Ink_Canvas
|
namespace Ink_Canvas
|
||||||
{
|
{
|
||||||
@@ -56,7 +51,7 @@ namespace Ink_Canvas
|
|||||||
TextBlockSecond.Text = "00";
|
TextBlockSecond.Text = "00";
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
isTimerRunning = false;
|
isTimerRunning = false;
|
||||||
FontIconStart.Glyph = "";
|
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play;
|
||||||
BtnStartCover.Visibility = Visibility.Visible;
|
BtnStartCover.Visibility = Visibility.Visible;
|
||||||
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
|
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
|
||||||
BorderStopTime.Visibility = Visibility.Collapsed;
|
BorderStopTime.Visibility = Visibility.Collapsed;
|
||||||
@@ -75,23 +70,23 @@ namespace Ink_Canvas
|
|||||||
|
|
||||||
SoundPlayer player = new SoundPlayer();
|
SoundPlayer player = new SoundPlayer();
|
||||||
|
|
||||||
int hour;
|
int hour = 0;
|
||||||
int minute = 1;
|
int minute = 1;
|
||||||
int second;
|
int second = 0;
|
||||||
int totalSeconds = 60;
|
int totalSeconds = 60;
|
||||||
|
|
||||||
DateTime startTime = DateTime.Now;
|
DateTime startTime = DateTime.Now;
|
||||||
DateTime pauseTime = DateTime.Now;
|
DateTime pauseTime = DateTime.Now;
|
||||||
|
|
||||||
bool isTimerRunning;
|
bool isTimerRunning = false;
|
||||||
bool isPaused;
|
bool isPaused = false;
|
||||||
|
|
||||||
Timer timer = new Timer();
|
Timer timer = new Timer();
|
||||||
|
|
||||||
private void Grid_MouseUp(object sender, MouseButtonEventArgs e)
|
private void Grid_MouseUp(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
if (isTimerRunning) return;
|
if (isTimerRunning) return;
|
||||||
if (ProcessBarTime.Visibility == Visibility.Visible && !isTimerRunning)
|
if (ProcessBarTime.Visibility == Visibility.Visible && isTimerRunning == false)
|
||||||
{
|
{
|
||||||
ProcessBarTime.Visibility = Visibility.Collapsed;
|
ProcessBarTime.Visibility = Visibility.Collapsed;
|
||||||
GridAdjustHour.Visibility = Visibility.Visible;
|
GridAdjustHour.Visibility = Visibility.Visible;
|
||||||
@@ -207,12 +202,12 @@ namespace Ink_Canvas
|
|||||||
if (WindowState == WindowState.Normal)
|
if (WindowState == WindowState.Normal)
|
||||||
{
|
{
|
||||||
WindowState = WindowState.Maximized;
|
WindowState = WindowState.Maximized;
|
||||||
FontIconFullscreen.Text = "";
|
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.BackToWindow;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
WindowState = WindowState.Normal;
|
WindowState = WindowState.Normal;
|
||||||
FontIconFullscreen.Text = "";
|
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.FullScreen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -227,6 +222,7 @@ namespace Ink_Canvas
|
|||||||
BtnStartCover.Visibility = Visibility.Collapsed;
|
BtnStartCover.Visibility = Visibility.Collapsed;
|
||||||
BorderStopTime.Visibility = Visibility.Collapsed;
|
BorderStopTime.Visibility = Visibility.Collapsed;
|
||||||
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
|
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if (isTimerRunning && isPaused)
|
else if (isTimerRunning && isPaused)
|
||||||
{
|
{
|
||||||
@@ -237,7 +233,7 @@ namespace Ink_Canvas
|
|||||||
BtnStartCover.Visibility = Visibility.Collapsed;
|
BtnStartCover.Visibility = Visibility.Collapsed;
|
||||||
BorderStopTime.Visibility = Visibility.Collapsed;
|
BorderStopTime.Visibility = Visibility.Collapsed;
|
||||||
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
|
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
|
||||||
FontIconStart.Glyph = "";
|
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play;
|
||||||
isTimerRunning = false;
|
isTimerRunning = false;
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
isPaused = false;
|
isPaused = false;
|
||||||
@@ -287,7 +283,7 @@ namespace Ink_Canvas
|
|||||||
startTime += DateTime.Now - pauseTime;
|
startTime += DateTime.Now - pauseTime;
|
||||||
ProcessBarTime.IsPaused = false;
|
ProcessBarTime.IsPaused = false;
|
||||||
TextBlockHour.Foreground = Brushes.Black;
|
TextBlockHour.Foreground = Brushes.Black;
|
||||||
FontIconStart.Glyph = "";
|
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Pause;
|
||||||
isPaused = false;
|
isPaused = false;
|
||||||
timer.Start();
|
timer.Start();
|
||||||
UpdateStopTime();
|
UpdateStopTime();
|
||||||
@@ -299,7 +295,7 @@ namespace Ink_Canvas
|
|||||||
pauseTime = DateTime.Now;
|
pauseTime = DateTime.Now;
|
||||||
ProcessBarTime.IsPaused = true;
|
ProcessBarTime.IsPaused = true;
|
||||||
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
|
TextBlockHour.Foreground = new SolidColorBrush(StringToColor("#FF5B5D5F"));
|
||||||
FontIconStart.Glyph = "";
|
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Play;
|
||||||
BorderStopTime.Visibility = Visibility.Collapsed;
|
BorderStopTime.Visibility = Visibility.Collapsed;
|
||||||
isPaused = true;
|
isPaused = true;
|
||||||
timer.Stop();
|
timer.Stop();
|
||||||
@@ -311,7 +307,7 @@ namespace Ink_Canvas
|
|||||||
totalSeconds = ((hour * 60) + minute) * 60 + second;
|
totalSeconds = ((hour * 60) + minute) * 60 + second;
|
||||||
ProcessBarTime.IsPaused = false;
|
ProcessBarTime.IsPaused = false;
|
||||||
TextBlockHour.Foreground = Brushes.Black;
|
TextBlockHour.Foreground = Brushes.Black;
|
||||||
FontIconStart.Glyph = "";
|
SymbolIconStart.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.Pause;
|
||||||
BtnResetCover.Visibility = Visibility.Collapsed;
|
BtnResetCover.Visibility = Visibility.Collapsed;
|
||||||
|
|
||||||
if (totalSeconds <= 10)
|
if (totalSeconds <= 10)
|
||||||
@@ -339,7 +335,7 @@ namespace Ink_Canvas
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Window_Closing(object sender, CancelEventArgs e)
|
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||||
{
|
{
|
||||||
isTimerRunning = false;
|
isTimerRunning = false;
|
||||||
}
|
}
|
||||||
@@ -349,7 +345,7 @@ namespace Ink_Canvas
|
|||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool _isInCompact;
|
private bool _isInCompact = false;
|
||||||
|
|
||||||
private void BtnMinimal_OnMouseUp(object sender, MouseButtonEventArgs e)
|
private void BtnMinimal_OnMouseUp(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
@@ -363,13 +359,12 @@ namespace Ink_Canvas
|
|||||||
// Set to center
|
// Set to center
|
||||||
double dpiScaleX = 1, dpiScaleY = 1;
|
double dpiScaleX = 1, dpiScaleY = 1;
|
||||||
PresentationSource source = PresentationSource.FromVisual(this);
|
PresentationSource source = PresentationSource.FromVisual(this);
|
||||||
if (source != null)
|
if (source != null) {
|
||||||
{
|
|
||||||
dpiScaleX = source.CompositionTarget.TransformToDevice.M11;
|
dpiScaleX = source.CompositionTarget.TransformToDevice.M11;
|
||||||
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
|
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
|
||||||
}
|
}
|
||||||
IntPtr windowHandle = new WindowInteropHelper(this).Handle;
|
IntPtr windowHandle = new WindowInteropHelper(this).Handle;
|
||||||
Screen screen = Screen.FromHandle(windowHandle);
|
System.Windows.Forms.Screen screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
|
||||||
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
|
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
|
||||||
Left = (screenWidth / 2) - (Width / 2);
|
Left = (screenWidth / 2) - (Width / 2);
|
||||||
Top = (screenHeight / 2) - (Height / 2);
|
Top = (screenHeight / 2) - (Height / 2);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@
|
|||||||
</Viewbox>
|
</Viewbox>
|
||||||
</ui:SimpleStackPanel>
|
</ui:SimpleStackPanel>
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
<Viewbox Margin="20,20,20,20" HorizontalAlignment="Right">
|
<Viewbox Visibility="{Binding ElementName=BigViewController, Path=Visibility}" Margin="20,20,20,20" HorizontalAlignment="Right">
|
||||||
<ui:SimpleStackPanel Height="180" Orientation="Horizontal">
|
<ui:SimpleStackPanel Height="180" Orientation="Horizontal">
|
||||||
<Border x:Name="BtnFullscreen" MouseUp="BtnFullscreen_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
<Border x:Name="BtnFullscreen" MouseUp="BtnFullscreen_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||||
Margin="5"
|
Margin="5"
|
||||||
@@ -80,7 +80,7 @@
|
|||||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Viewbox Margin="5.5">
|
<Viewbox Margin="5.5">
|
||||||
<TextBlock Name="FontIconFullscreen" Text="" Foreground="Black" FontFamily="Segoe MDL2 Assets" FontSize="12" />
|
<ui:SymbolIcon Name="SymbolIconFullscreen" Symbol="FullScreen" Foreground="Black"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Border>
|
</Border>
|
||||||
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
<Border x:Name="BtnClose" MouseUp="BtnClose_MouseUp" HorizontalAlignment="Right" VerticalAlignment="Bottom"
|
||||||
@@ -90,7 +90,7 @@
|
|||||||
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
<DropShadowEffect Direction="0" ShadowDepth="0" Opacity="0.1" BlurRadius="3"/>
|
||||||
</Border.Effect>
|
</Border.Effect>
|
||||||
<Viewbox Margin="5.5">
|
<Viewbox Margin="5.5">
|
||||||
<TextBlock Text="" Foreground="White" FontFamily="Segoe MDL2 Assets" FontSize="12" />
|
<ui:SymbolIcon Symbol="Clear" Foreground="White"/>
|
||||||
</Viewbox>
|
</Viewbox>
|
||||||
</Border>
|
</Border>
|
||||||
</ui:SimpleStackPanel>
|
</ui:SimpleStackPanel>
|
||||||
|
|||||||
@@ -25,22 +25,17 @@ namespace Ink_Canvas
|
|||||||
if (e.LeftButton == MouseButtonState.Pressed) DragMove();
|
if (e.LeftButton == MouseButtonState.Pressed) DragMove();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void BtnFullscreen_MouseUp(object sender, MouseButtonEventArgs e)
|
private void BtnFullscreen_MouseUp(object sender, MouseButtonEventArgs e) {
|
||||||
{
|
if (WindowState == WindowState.Normal) {
|
||||||
if (WindowState == WindowState.Normal)
|
|
||||||
{
|
|
||||||
WindowState = WindowState.Maximized;
|
WindowState = WindowState.Maximized;
|
||||||
FontIconFullscreen.Text = "";
|
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.BackToWindow;
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
WindowState = WindowState.Normal;
|
WindowState = WindowState.Normal;
|
||||||
FontIconFullscreen.Text = "";
|
SymbolIconFullscreen.Symbol = iNKORE.UI.WPF.Modern.Controls.Symbol.FullScreen;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void SCManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
|
private void SCManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e) {
|
||||||
{
|
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user