inital
This commit is contained in:
43
FasdDesktopUi/Pages/SuccessPage/SuccessPage.xaml
Normal file
43
FasdDesktopUi/Pages/SuccessPage/SuccessPage.xaml
Normal file
@@ -0,0 +1,43 @@
|
||||
<Window x:Class="FasdDesktopUi.Pages.SuccessPage.SuccessPage"
|
||||
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:FasdDesktopUi.Pages.SuccessPage"
|
||||
xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
|
||||
mc:Ignorable="d"
|
||||
d:Height="300"
|
||||
d:Width="300"
|
||||
Background="Transparent"
|
||||
AllowsTransparency="True"
|
||||
WindowStyle="none"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
ShowInTaskbar="False"
|
||||
Topmost="True"
|
||||
IsVisibleChanged="BlurInvoker_IsActiveChanged">
|
||||
|
||||
<Border x:Name="MainBorder"
|
||||
CornerRadius="20"
|
||||
Background="{DynamicResource Color.AppBackground}"
|
||||
Height="250"
|
||||
Width="250">
|
||||
<Grid>
|
||||
<ico:AdaptableIcon x:Name="SuccessIcon"
|
||||
IconWidth="250"
|
||||
IconHeight="250"
|
||||
SelectedInternGif="partyPopper"
|
||||
BorderPadding="45 0 0 45" />
|
||||
|
||||
<ico:AdaptableIcon x:Name="CloseButton"
|
||||
Style="{DynamicResource SettingsPage.Close.Icon}"
|
||||
SelectedInternIcon="window_close"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Top"
|
||||
Margin="7.5 2.5"
|
||||
MouseLeftButtonUp="CloseButton_MouseLeftButtonUp"
|
||||
TouchDown="CloseButton_TouchDown" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
</Window>
|
||||
68
FasdDesktopUi/Pages/SuccessPage/SuccessPage.xaml.cs
Normal file
68
FasdDesktopUi/Pages/SuccessPage/SuccessPage.xaml.cs
Normal file
@@ -0,0 +1,68 @@
|
||||
using FasdDesktopUi.Basics.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Shapes;
|
||||
using static C4IT.Logging.cLogManager;
|
||||
|
||||
namespace FasdDesktopUi.Pages.SuccessPage
|
||||
{
|
||||
public partial class SuccessPage : Window, IBlurInvoker
|
||||
{
|
||||
public SuccessPage()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void CloseButton_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void CloseButton_TouchDown(object sender, TouchEventArgs e)
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
public async void BlurInvoker_IsActiveChanged(object sender, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
BlurInvoker.InvokeVisibilityChanged(this, new EventArgs());
|
||||
|
||||
if (!IsVisible)
|
||||
return;
|
||||
|
||||
const int delayInMilliSeconds = 750;
|
||||
const int animationDurationInMilliSeconds = 750;
|
||||
|
||||
await Task.Delay(delayInMilliSeconds);
|
||||
DoubleAnimation opacityAnimation = new DoubleAnimation(0, TimeSpan.FromMilliseconds(animationDurationInMilliSeconds));
|
||||
MainBorder.BeginAnimation(OpacityProperty, opacityAnimation);
|
||||
await Task.Delay(animationDurationInMilliSeconds);
|
||||
Close();
|
||||
|
||||
}
|
||||
catch (Exception E)
|
||||
{
|
||||
LogException(E);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public bool BlurInvoker_IsActive => IsVisible;
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user