Skip to content

Portable Tool for an Ideal Windows Setup

-edit mvvm - collections, fixed task run in background

Greedeksff928db6e686
diff --git a/.Source/GTweak/Core/Model/DataSystemModel.cs b/.Source/GTweak/Core/Model/DataSystemModel.cs
index f62d672e..d8fd0604 100644
--- a/.Source/GTweak/Core/Model/DataSystemModel.cs
+++ b/.Source/GTweak/Core/Model/DataSystemModel.cs
@@ -4,17 +4,8 @@ namespace GTweak.Core.Model
{
internal sealed class DataSystemModel
{
- internal string WindowsDescriptions { get; set; }
- internal string BiosDescriptions { get; set; }
- internal string MotherBrDescriptions { get; set; }
- internal string CpuDescriptions { get; set; }
- internal string GpuDescriptions { get; set; }
- internal string RamDescriptions { get; set; }
- internal string StorageDescriptions { get; set; }
- internal string AudioDescriptions { get; set; }
- internal string NetworkDescriptions { get; set; }
- internal string UserIpAddress { get; set; }
- internal string NumberProcesses { get; set; }
+ public string ItemName { get; set; }
+ public string Data { get; set; }
internal int BlurValue { get; set; }
internal Visibility IpVisibility { get; set; }
}
diff --git a/.Source/GTweak/Core/ViewModel/DataSystemVM.cs b/.Source/GTweak/Core/ViewModel/DataSystemVM.cs
index 67eedbab..e9057dd9 100644
--- a/.Source/GTweak/Core/ViewModel/DataSystemVM.cs
+++ b/.Source/GTweak/Core/ViewModel/DataSystemVM.cs
@@ -1,79 +1,24 @@
using GTweak.Core.Model;
using GTweak.Utilities;
using GTweak.Utilities.Tweaks;
+using System.Collections.ObjectModel;
+using System.Linq;
using System.Windows;
+
namespace GTweak.Core.ViewModel
{
internal class DataSystemVM : ViewModelBase
{
private readonly DataSystemModel model;
+ private ObservableCollection<DataSystemModel> collection;
- public string DisplayWindows
- {
- get => model.WindowsDescriptions;
- set { model.WindowsDescriptions = value; OnPropertyChanged(); }
- }
-
- public string DisplayBios
- {
- get => model.BiosDescriptions;
- set { model.BiosDescriptions = value; OnPropertyChanged(); }
- }
-
- public string DisplayMotherBr
- {
- get => model.MotherBrDescriptions;
- set { model.MotherBrDescriptions = value; OnPropertyChanged(); }
- }
-
- public string DisplayCpu
- {
- get => model.CpuDescriptions;
- set { model.CpuDescriptions = value; OnPropertyChanged(); }
- }
-
- public string DisplayGpu
- {
- get => model.GpuDescriptions;
- set { model.GpuDescriptions = value; OnPropertyChanged(); }
- }
-
- public string DisplayRam
- {
- get => model.RamDescriptions;
- set { model.RamDescriptions = value; OnPropertyChanged(); }
- }
-
- public string DisplayStorage
- {
- get => model.StorageDescriptions;
- set { model.StorageDescriptions = value; OnPropertyChanged(); }
- }
-
- public string DisplayAudio
+ public ObservableCollection<DataSystemModel> DisplayData
{
- get => model.AudioDescriptions;
- set { model.AudioDescriptions = value; OnPropertyChanged(); }
- }
-
- public string DisplayNetwork
- {
- get => model.NetworkDescriptions;
- set { model.NetworkDescriptions = value; OnPropertyChanged(); }
- }
-
- public string DisplayIpAddress
- {
- get => model.UserIpAddress;
- set { model.UserIpAddress = value; OnPropertyChanged(); }
- }
-
- public string DisplayNumberProcesses
- {
- get => model.NumberProcesses;
- set { model.NumberProcesses = value; OnPropertyChanged(); }
+ get => collection;
+ set { collection = value; OnPropertyChanged(); }
}
+ public DataSystemModel this[string name] => DisplayData.FirstOrDefault(d => d.ItemName == name);
public int SetBlurValue
{
@@ -97,19 +42,20 @@ namespace GTweak.Core.ViewModel
{
model = new DataSystemModel();
- DisplayWindows = SystemData.СomputerСonfiguration.СonfigurationData["Windows"];
- DisplayNumberProcesses = new SystemData.MonitoringSystem().GetNumberRunningProcesses;
-
- DisplayBios = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["BIOS"]) ? SystemData.СomputerСonfiguration.СonfigurationData["BIOS"] : (string)Application.Current.Resources["no_device_information_systemInformatin"];
- DisplayMotherBr = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["MotherBr"]) ? SystemData.СomputerСonfiguration.СonfigurationData["MotherBr"] : (string)Application.Current.Resources["no_device_information_systemInformatin"];
- DisplayCpu = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["CPU"]) ? SystemData.СomputerСonfiguration.СonfigurationData["CPU"] : (string)Application.Current.Resources["no_device_information_systemInformatin"];
- DisplayGpu = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["GPU"]) ? SystemData.СomputerСonfiguration.СonfigurationData["GPU"] : (string)Application.Current.Resources["driver_not_installed_systemInformatin"];
- DisplayRam = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["RAM"]) ? SystemData.СomputerСonfiguration.СonfigurationData["RAM"] : (string)Application.Current.Resources["no_device_information_systemInformatin"];
- DisplayStorage = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["Storage"]) ? SystemData.СomputerСonfiguration.СonfigurationData["Storage"] : (string)Application.Current.Resources["no_device_information_systemInformatin"];
- DisplayAudio = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["Audio"]) ? SystemData.СomputerСonfiguration.СonfigurationData["Audio"] : (string)Application.Current.Resources["driver_not_installed_systemInformatin"];
- DisplayNetwork = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["NetAdapter"]) ? SystemData.СomputerСonfiguration.СonfigurationData["NetAdapter"] : (string)Application.Current.Resources["driver_not_installed_systemInformatin"];
-
- DisplayIpAddress = SystemData.СomputerСonfiguration.СonfigurationData["UserIpAddress"];
+ DisplayData = new ObservableCollection<DataSystemModel>
+ {
+ new DataSystemModel { ItemName = "Windows", Data = SystemData.СomputerСonfiguration.СonfigurationData["Windows"] },
+ new DataSystemModel { ItemName = "Processes", Data = new SystemData.MonitoringSystem().GetNumberRunningProcesses },
+ new DataSystemModel { ItemName = "Bios", Data = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["BIOS"]) ? SystemData.СomputerСonfiguration.СonfigurationData["BIOS"] : (string)Application.Current.Resources["no_device_information_systemInformatin"] },
+ new DataSystemModel { ItemName = "MotherBr", Data = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["MotherBr"]) ? SystemData.СomputerСonfiguration.СonfigurationData["MotherBr"] : (string)Application.Current.Resources["no_device_information_systemInformatin"] },
+ new DataSystemModel { ItemName = "Cpu", Data = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["CPU"]) ? SystemData.СomputerСonfiguration.СonfigurationData["CPU"] : (string)Application.Current.Resources["no_device_information_systemInformatin"] },
+ new DataSystemModel { ItemName = "Gpu", Data = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["GPU"]) ? SystemData.СomputerСonfiguration.СonfigurationData["GPU"] : (string)Application.Current.Resources["driver_not_installed_systemInformatin"] },
+ new DataSystemModel { ItemName = "Ram", Data = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["RAM"]) ? SystemData.СomputerСonfiguration.СonfigurationData["RAM"] : (string)Application.Current.Resources["no_device_information_systemInformatin"] },
+ new DataSystemModel { ItemName = "Storage", Data = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["Storage"]) ? SystemData.СomputerСonfiguration.СonfigurationData["Storage"] : (string)Application.Current.Resources["no_device_information_systemInformatin"] },
+ new DataSystemModel { ItemName = "Audio", Data = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["Audio"]) ? SystemData.СomputerСonfiguration.СonfigurationData["Audio"] : (string)Application.Current.Resources["driver_not_installed_systemInformatin"] },
+ new DataSystemModel { ItemName = "Network", Data = !string.IsNullOrEmpty(SystemData.СomputerСonfiguration.СonfigurationData["NetAdapter"]) ? SystemData.СomputerСonfiguration.СonfigurationData["NetAdapter"] : (string)Application.Current.Resources["driver_not_installed_systemInformatin"] },
+ new DataSystemModel { ItemName = "Ip", Data = SystemData.СomputerСonfiguration.СonfigurationData["UserIpAddress"] }
+ };
if (Settings.IsHiddenIpAddress & SystemData.СomputerСonfiguration.ConnectionStatus == 0)
{
diff --git a/.Source/GTweak/Styles/Buttons.xaml b/.Source/GTweak/Styles/Buttons.xaml
index f9e3c0fa..2df2944a 100644
--- a/.Source/GTweak/Styles/Buttons.xaml
+++ b/.Source/GTweak/Styles/Buttons.xaml
@@ -23,7 +23,7 @@
<Trigger Property="Visibility" Value="Visible">
<Setter Property="RenderTransform">
<Setter.Value>
- <TranslateTransform X="0" Y="10"/>
+ <TranslateTransform X="0" Y="0"/>
</Setter.Value>
</Setter>
</Trigger>
@@ -40,7 +40,7 @@
</EventTrigger>
</Style.Triggers>
</Style>
-
+
<Style TargetType="{x:Type Button}" x:Key="BtnDefault">
<Setter Property="Foreground" Value="{StaticResource Color_Background_Dark}"/>
<Setter Property="Background" Value="{StaticResource Color_Accent}"/>
diff --git a/.Source/GTweak/Utilities/Helpers/BackgroundQueue.cs b/.Source/GTweak/Utilities/Helpers/BackgroundQueue.cs
index 67914d71..05289a3b 100644
--- a/.Source/GTweak/Utilities/Helpers/BackgroundQueue.cs
+++ b/.Source/GTweak/Utilities/Helpers/BackgroundQueue.cs
@@ -33,10 +33,16 @@ namespace GTweak.Utilities.Helpers
}
}
- internal void QueueCompleted(Action action)
+ internal Task QueueCompleted(Action action)
{
- if (previousTask.IsCompleted)
- action();
+ lock (key)
+ {
+ previousTask = previousTask.ContinueWith(t => action(),
+ CancellationToken.None,
+ TaskContinuationOptions.None,
+ TaskScheduler.Default);
+ return previousTask;
+ }
}
}
}
diff --git a/.Source/GTweak/Utilities/Helpers/TypewriterAnimation.cs b/.Source/GTweak/Utilities/Helpers/TypewriterAnimation.cs
index 64cb8015..38f3fc62 100644
--- a/.Source/GTweak/Utilities/Helpers/TypewriterAnimation.cs
+++ b/.Source/GTweak/Utilities/Helpers/TypewriterAnimation.cs
@@ -10,12 +10,30 @@ namespace GTweak.Utilities.Helpers
internal TypewriterAnimation(string textToAnimate, TextBlock textBlock, TimeSpan timeSpan)
{
if (!(textBlock.FindName(textBlock.Name) is TextBlock)) return;
- Storyboard storyBoard = new Storyboard()
+
+ Storyboard storyBoard = new Storyboard
{
FillBehavior = FillBehavior.HoldEnd
};
- StringAnimationUsingKeyFrames stringAnimationUsingKeyFrames = new StringAnimationUsingKeyFrames()
+ StringAnimationUsingKeyFrames stringAnimation = StringAnimation(textToAnimate, timeSpan);
+
+ Storyboard.SetTargetName(stringAnimation, textBlock.Name);
+ Storyboard.SetTargetProperty(stringAnimation, new PropertyPath(TextBlock.TextProperty));
+ storyBoard.Children.Add(stringAnimation);
+
+ DoubleAnimation opacityAnimation = OpacityAnimation(timeSpan);
+ Storyboard.SetTargetName(opacityAnimation, textBlock.Name);
+ Storyboard.SetTargetProperty(opacityAnimation, new PropertyPath(UIElement.OpacityProperty));
+ storyBoard.Children.Add(opacityAnimation);
+
+ textBlock.BeginStoryboard(storyBoard);
+ storyBoard.Remove(textBlock);
+ }
+
+ private StringAnimationUsingKeyFrames StringAnimation(string textToAnimate, TimeSpan timeSpan)
+ {
+ StringAnimationUsingKeyFrames stringAnimation = new StringAnimationUsingKeyFrames
{
Duration = new Duration(timeSpan)
};
@@ -23,21 +41,22 @@ namespace GTweak.Utilities.Helpers
string temp = string.Empty;
foreach (char data in textToAnimate)
{
- DiscreteStringKeyFrame discreteStringKeyFrame = new DiscreteStringKeyFrame
+ temp += data;
+ DiscreteStringKeyFrame keyFrame = new DiscreteStringKeyFrame
{
- KeyTime = KeyTime.Paced
+ KeyTime = KeyTime.Paced,
+ Value = temp
};
- temp += data;
- discreteStringKeyFrame.Value = temp;
- stringAnimationUsingKeyFrames.KeyFrames.Add(discreteStringKeyFrame);
+ stringAnimation.KeyFrames.Add(keyFrame);
}
- Timeline.SetDesiredFrameRate(stringAnimationUsingKeyFrames, 400);
- Storyboard.SetTargetName(stringAnimationUsingKeyFrames, textBlock.Name);
- Storyboard.SetTargetProperty(stringAnimationUsingKeyFrames, new PropertyPath(TextBlock.TextProperty));
- storyBoard.Children.Add(stringAnimationUsingKeyFrames);
+ Timeline.SetDesiredFrameRate(stringAnimation, 400);
+ return stringAnimation;
+ }
- DoubleAnimation doubleAnim = new DoubleAnimation()
+ private DoubleAnimation OpacityAnimation(TimeSpan timeSpan)
+ {
+ DoubleAnimation opacityAnimation = new DoubleAnimation
{
From = 0,
To = 1,
@@ -45,13 +64,8 @@ namespace GTweak.Utilities.Helpers
EasingFunction = new QuadraticEase()
};
- Timeline.SetDesiredFrameRate(doubleAnim, 400);
- Storyboard.SetTargetName(doubleAnim, textBlock.Name);
- Storyboard.SetTargetProperty(doubleAnim, new PropertyPath(UIElement.OpacityProperty));
- storyBoard.Children.Add(doubleAnim);
-
- textBlock.BeginStoryboard(storyBoard);
- storyBoard.Remove(textBlock);
+ Timeline.SetDesiredFrameRate(opacityAnimation, 400);
+ return opacityAnimation;
}
}
}
diff --git a/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs b/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs
index 4877c324..14850452 100644
--- a/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs
+++ b/.Source/GTweak/Utilities/Tweaks/ClearingMemory.cs
@@ -222,11 +222,7 @@ namespace GTweak.Utilities.Tweaks
{
BackgroundQueue backgroundQueue = new BackgroundQueue();
await backgroundQueue.QueueTask(delegate { ClearFileSystemCache(true); EmptyWorkingSetFunction(); ClearTempSystemCache(); });
- backgroundQueue.QueueCompleted(async delegate
- {
- await Task.Delay(1000);
- new ViewNotification().Show("", "info", (string)Application.Current.Resources["clear_ram_notification"]);
- });
+ new ViewNotification(500).Show("", "info", (string)Application.Current.Resources["clear_ram_notification"]);
}
}
}
diff --git a/.Source/GTweak/Utilities/Tweaks/RecoveryPoint.cs b/.Source/GTweak/Utilities/Tweaks/RecoveryPoint.cs
index 3b2c97d3..b4cf922c 100644
--- a/.Source/GTweak/Utilities/Tweaks/RecoveryPoint.cs
+++ b/.Source/GTweak/Utilities/Tweaks/RecoveryPoint.cs
@@ -5,6 +5,7 @@ using System.Diagnostics;
using System.Management;
using System.Runtime.InteropServices;
using System.Threading.Tasks;
+using System.Windows;
namespace GTweak.Utilities.Tweaks
{
@@ -17,12 +18,12 @@ namespace GTweak.Utilities.Tweaks
private static readonly ManagementClass RestorePoint = new ManagementClass(new ManagementScope(@"\\localhost\root\default"), new ManagementPath("SystemRestore"), new ObjectGetOptions());
private static ManagementBaseObject InParams;
private static bool isWorkingCreatePoint = false;
- private static string resultRead = string.Empty;
+ private static string output = string.Empty;
- internal static bool IsAlreadyPoint()
+ internal static async Task<bool> IsAlreadyPointAsync()
{
- StartPowerShell(@"Get-ComputerRestorePoint | Where-Object {$_.Description -ne 'Точка созданная с помощью GTweak' -and $_.Description -ne 'A point created with a GTweak'} | Select-Object EventType | ft -hide");
- return resultRead.Contains("100");
+ await StartPowerShellAsync(@"Get-ComputerRestorePoint | Where-Object {$_.Description -ne 'Точка созданная с помощью GTweak' -and $_.Description -ne 'A point created with a GTweak'} | Select-Object EventType | ft -hide");
+ return output.Contains("100");
}
@@ -65,22 +66,31 @@ namespace GTweak.Utilities.Tweaks
isWorkingCreatePoint = true;
- EnablePoint();
+ try
+ {
+ EnablePoint();
- if (StartPowerShell(@"Get-ComputerRestorePoint | Where-Object {$_.Description -eq 'Точка созданная с помощью GTweak' -or $_.Description -eq 'A point created with a GTweak'} | Select-Object SequenceNumber | ft -hide") != string.Empty)
- SRRemoveRestorePoint(Convert.ToInt32(resultRead.Trim()));
+ await StartPowerShellAsync(@"Get-ComputerRestorePoint | Where-Object {$_.Description -eq 'Точка созданная с помощью GTweak' -or $_.Description -eq 'A point created with a GTweak'} | Select-Object SequenceNumber | ft -hide");
- InParams = RestorePoint.GetMethodParameters("CreateRestorePoint");
- InParams["Description"] = description;
- InParams["EventType"] = 100;
- InParams["RestorePointType"] = 12;
- RestorePoint.InvokeMethod("CreateRestorePoint", InParams, null);
+ if (!string.IsNullOrEmpty(output))
+ SRRemoveRestorePoint(Convert.ToInt32(output.Trim()));
- await Task.Delay(200);
+ InParams = RestorePoint.GetMethodParameters("CreateRestorePoint");
+ InParams["Description"] = description;
+ InParams["EventType"] = 100;
+ InParams["RestorePointType"] = 12;
+ RestorePoint.InvokeMethod("CreateRestorePoint", InParams, null);
- RestorePoint.Dispose();
+ await Task.Delay(200);
+
+ RestorePoint.Dispose();
+
+ isWorkingCreatePoint = false;
+
+ new ViewNotification(300).Show("", "info", (string)Application.Current.Resources["successpoint_notification"]);
+ }
+ catch { new ViewNotification(300).Show("", "warn", (string)Application.Current.Resources["notsuccessfulpoint_notification"]); }
- isWorkingCreatePoint = false;
}
internal static void Run()
@@ -140,31 +150,29 @@ namespace GTweak.Utilities.Tweaks
DisableSR(UsePath.SystemDisk + @"\\");
}
- private static string StartPowerShell(string arguments)
+ private static async Task<string> StartPowerShellAsync(string arguments)
{
- Parallel.Invoke(() =>
+ var startInfo = new ProcessStartInfo
{
- ProcessStartInfo startInfo = new ProcessStartInfo
- {
- FileName = @"powershell.exe",
- Arguments = arguments,
- RedirectStandardOutput = true,
- RedirectStandardError = true,
- UseShellExecute = false,
- CreateNoWindow = true
- };
+ FileName = "powershell.exe",
+ Arguments = arguments,
+ RedirectStandardOutput = true,
+ RedirectStandardError = true,
+ UseShellExecute = false,
+ CreateNoWindow = true
+ };
- Process process = new Process() { StartInfo = startInfo, EnableRaisingEvents = true };
+ using Process process = new Process { StartInfo = startInfo };
- process.Start();
+ process.Start();
- resultRead = process.StandardOutput.ReadToEnd();
+ Task<string> outputTask = process.StandardOutput.ReadToEndAsync();
- process.Close();
- process.Dispose();
- });
+ await Task.WhenAll(outputTask);
+
+ output = await outputTask;
- return resultRead;
+ return output;
}
}
}
diff --git a/.Source/GTweak/Utilities/Tweaks/SystemData.cs b/.Source/GTweak/Utilities/Tweaks/SystemData.cs
index d6f762a7..1dcbc1d0 100644
--- a/.Source/GTweak/Utilities/Tweaks/SystemData.cs
+++ b/.Source/GTweak/Utilities/Tweaks/SystemData.cs
@@ -87,17 +87,20 @@ namespace GTweak.Utilities.Tweaks
return -1;
}
+ internal int GetMemoryUsage() => (int)Math.Truncate(100 - ((decimal)GetPhysicalAvailableMemory() / GetTotalMemory() * 100) + (decimal)0.5);
+
internal string GetNumberRunningProcesses => Process.GetProcesses().Length.ToString();
- internal async void GetProcessorUsage()
+ internal static async Task GetProcessorUsage()
{
- PerformanceCounter cpuCounter = new PerformanceCounter("Processor Information", "% Processor Utility", "_Total", true);
- cpuCounter.NextValue();
- await Task.Delay(1000);
- PercentageProcessorUsage = (int)cpuCounter.NextValue();
+ await Task.Run(async () =>
+ {
+ using PerformanceCounter cpuCounter = new PerformanceCounter("Processor Information", "% Processor Utility", "_Total", true);
+ cpuCounter.NextValue();
+ await Task.Delay(1000);
+ PercentageProcessorUsage = (int)cpuCounter.NextValue();
+ });
}
-
- internal int GetMemoryUsage() => (int)Math.Truncate(100 - ((decimal)GetPhysicalAvailableMemory() / GetTotalMemory() * 100) + (decimal)0.5);
}
internal class СomputerСonfiguration
@@ -226,7 +229,6 @@ namespace GTweak.Utilities.Tweaks
});
}
-
internal static bool IsNetworkAvailable()
{
try
diff --git a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
index d9afc31c..156d2b30 100644
--- a/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
+++ b/.Source/GTweak/Utilities/Tweaks/UninstallingPakages.cs
@@ -4,7 +4,6 @@ using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
-using System.Threading.Tasks;
namespace GTweak.Utilities.Tweaks
{
@@ -137,15 +136,13 @@ namespace GTweak.Utilities.Tweaks
}
- internal async static void DeletingPackage(string packageName)
+ internal static void DeletingPackage(string packageName)
{
if (packageName == "OneDrive")
DeletedOneDrive();
else
{
- IsAppUnavailable[packageName] = true;
-
using (Process process = new Process())
{
process.StartInfo.UseShellExecute = false;
@@ -172,9 +169,6 @@ namespace GTweak.Utilities.Tweaks
process.WaitForExit(1000);
UserPackages = UserPackages.Replace(packageName, string.Empty);
-
- await Task.Delay(8000);
- IsAppUnavailable[packageName] = false;
}
switch (packageName)
@@ -200,9 +194,9 @@ namespace GTweak.Utilities.Tweaks
}
}
- internal async static void DeletedOneDrive()
+ internal static void DeletedOneDrive()
{
- IsAppUnavailable["OneDrive"] = true;
+
using (Process process = new Process())
{
@@ -221,8 +215,6 @@ namespace GTweak.Utilities.Tweaks
RegistryHelp.DeleteFolderTree(Registry.ClassesRoot, @"Wow6432Node\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}");
}
- await Task.Delay(8000);
- IsAppUnavailable["OneDrive"] = false;
}
string argumentsFolders = @"/c rd /s /q %userprofile%\AppData\Local\Microsoft\OneDrive & rd /s /q %userprofile%\AppData\Local\OneDrive
@@ -240,10 +232,8 @@ namespace GTweak.Utilities.Tweaks
});
}
- internal async static void ResetOneDriveAsync()
+ internal static void ResetOneDrive()
{
- IsAppUnavailable["OneDrive"] = true;
-
using (Process process = new Process())
{
process.StartInfo.UseShellExecute = false;
@@ -253,14 +243,7 @@ namespace GTweak.Utilities.Tweaks
process.StartInfo.FileName = "cmd.exe";
process.StartInfo.Arguments = @"/c %systemroot%\System32\OneDriveSetup.exe & %systemroot%\SysWOW64\OneDriveSetup.exe";
process.Start();
-
- process.WaitForExit(7000);
-
- if (!process.HasExited)
- {
- await Task.Delay(500);
- IsAppUnavailable["OneDrive"] = false;
- }
+ process.WaitForExit(1000);
}
RegistryHelp.CreateFolder(Registry.ClassesRoot, @"CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}");
diff --git a/.Source/GTweak/View/DataSystemView.xaml b/.Source/GTweak/View/DataSystemView.xaml
index 167d1ab0..8690d135 100644
--- a/.Source/GTweak/View/DataSystemView.xaml
+++ b/.Source/GTweak/View/DataSystemView.xaml
@@ -57,7 +57,7 @@
<StackPanel Orientation="Horizontal">
<TextBlock Style="{StaticResource Text}" FontSize="15pt" Width="Auto" Height="65">
<Run Foreground="{StaticResource Color_Accent}" Text="{DynamicResource title_win_systemInformation}"/>
- <Run Foreground="{StaticResource Color_Highlighted}" Text="{Binding DisplayWindows}" PreviewMouseDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
+ <Run Foreground="{StaticResource Color_Highlighted}" Text="{Binding [Windows].Data}" PreviewMouseDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</TextBlock>
<Image x:Name="ImageWindows" Height="80" Width="80" HorizontalAlignment="Right" Margin="30,0,0,0">
<Image.Style>
@@ -69,7 +69,7 @@
</StackPanel>
<TextBlock x:Name="ViewCountProcess" HorizontalAlignment="Left" FontFamily="{StaticResource Jura}" FontSize="14" MaxWidth="300" Foreground="{StaticResource Color_Inactive}">
<Run Text="{DynamicResource runprocces_systemInformation}"/>
- <Run Text="{Binding DisplayNumberProcesses}"/>
+ <Run Text="{Binding [Processes].Data}"/>
</TextBlock>
</StackPanel>
</Grid>
@@ -115,28 +115,28 @@
<Grid Grid.Row="0">
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_bios_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
- <TextBlock Text="{Binding DisplayBios}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
+ <TextBlock Text="{Binding [Bios].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_motherbr_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
- <TextBlock Text="{Binding DisplayMotherBr}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
+ <TextBlock Text="{Binding [MotherBr].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</StackPanel>
</Grid>
<Grid Grid.Row="2">
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_cpu_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
- <TextBlock Text="{Binding DisplayCpu}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
+ <TextBlock Text="{Binding [Cpu].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</StackPanel>
</Grid>
<Grid Grid.Row="3">
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_gpu_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
- <TextBlock Text="{Binding DisplayGpu}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
+ <TextBlock Text="{Binding [Gpu].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</StackPanel>
</Grid>
@@ -144,7 +144,7 @@
<Grid Grid.Row="4">
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_ram_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
- <TextBlock Text="{Binding DisplayRam}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
+ <TextBlock Text="{Binding [Ram].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</StackPanel>
</Grid>
</Grid>
@@ -160,21 +160,21 @@
<Grid Grid.Row="0">
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_disk_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
- <TextBlock Text="{Binding DisplayStorage}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
+ <TextBlock Text="{Binding [Storage].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</StackPanel>
</Grid>
<Grid Grid.Row="1">
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_sound_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
- <TextBlock Text="{Binding DisplayAudio}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
+ <TextBlock Text="{Binding [Audio].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</StackPanel>
</Grid>
<Grid Grid.Row="2">
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_netadapter_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
- <TextBlock Text="{Binding DisplayNetwork}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
+ <TextBlock Text="{Binding [Network].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand"/>
</StackPanel>
</Grid>
@@ -182,7 +182,7 @@
<StackPanel Orientation="Vertical" Margin="50,20,0,0">
<TextBlock Text="{DynamicResource title_ip_systemInformation}" Style="{StaticResource Text}" Foreground="{StaticResource Color_Accent}" Height="Auto" Width="Auto"/>
<StackPanel Orientation="Horizontal">
- <TextBlock x:Name="IpAddress" Text="{Binding DisplayIpAddress}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand">
+ <TextBlock x:Name="IpAddress" Text="{Binding [Ip].Data}" Style="{StaticResource Text}" HorizontalAlignment="Left" Margin="15,0,0,0" Foreground="{StaticResource Color_Highlighted}" Height="Auto" Width="Auto" PreviewMouseLeftButtonDown="TextComputerData_PreviewMouseDown" Cursor="Hand">
<TextBlock.Effect>
<BlurEffect Radius="{Binding SetBlurValue}"/>
</TextBlock.Effect>
diff --git a/.Source/GTweak/View/DataSystemView.xaml.cs b/.Source/GTweak/View/DataSystemView.xaml.cs
index 55a2f2bd..a11186d3 100644
--- a/.Source/GTweak/View/DataSystemView.xaml.cs
+++ b/.Source/GTweak/View/DataSystemView.xaml.cs
@@ -3,7 +3,6 @@ using GTweak.Utilities;
using GTweak.Utilities.Helpers;
using GTweak.Utilities.Tweaks;
using System;
-using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
@@ -47,30 +46,25 @@ namespace GTweak.View
if (time.TotalSeconds % 2 == 0)
{
BackgroundQueue backgroundQueue = new BackgroundQueue();
- await backgroundQueue.QueueTask(delegate
+ await backgroundQueue.QueueTask(async delegate
{
Parallel.Invoke(SystemData.СomputerСonfiguration.UpdatingDeviceData);
- Thread _thread = new Thread(() => { new SystemData.MonitoringSystem().GetProcessorUsage(); }) { IsBackground = true };
- _thread.Start();
+ await SystemData.MonitoringSystem.GetProcessorUsage();
});
- backgroundQueue.QueueCompleted(delegate
+ Application.Current.Dispatcher.Invoke(AnimationProgressBars);
+ if (BtnHiddenIP.IsChecked.Value & BtnHiddenIP.Visibility == Visibility.Hidden)
{
- Application.Current.Dispatcher.Invoke(AnimationProgressBars);
-
- if (BtnHiddenIP.IsChecked.Value & BtnHiddenIP.Visibility == Visibility.Hidden)
- {
- DoubleAnimation doubleAnim = new DoubleAnimation(0, (Duration)TimeSpan.FromSeconds(0.18));
- doubleAnim.Completed += delegate { Parallel.Invoke(() => { Settings.ChangingParameters(false, "HiddenIP"); }); };
- Timeline.SetDesiredFrameRate(doubleAnim, 400);
- IpAddress.Effect.BeginAnimation(BlurEffect.RadiusProperty, doubleAnim);
- }
- });
+ DoubleAnimation doubleAnim = new DoubleAnimation(0, (Duration)TimeSpan.FromSeconds(0.18));
+ doubleAnim.Completed += delegate { Parallel.Invoke(() => { Settings.ChangingParameters(false, "HiddenIP"); }); };
+ Timeline.SetDesiredFrameRate(doubleAnim, 400);
+ IpAddress.Effect.BeginAnimation(BlurEffect.RadiusProperty, doubleAnim);
+ }
}
else if (time.TotalSeconds % 5 == 0)
{
BackgroundQueue backgroundQueue = new BackgroundQueue();
await backgroundQueue.QueueTask(delegate { SystemData.СomputerСonfiguration.GettingUserIP(); });
- backgroundQueue.QueueCompleted(delegate { DataContext = new DataSystemVM(); });
+ DataContext = new DataSystemVM();
}
time = time.Add(TimeSpan.FromSeconds(+1));
diff --git a/.Source/GTweak/View/MoreView.xaml b/.Source/GTweak/View/MoreView.xaml
index 7017b3ff..75964121 100644
--- a/.Source/GTweak/View/MoreView.xaml
+++ b/.Source/GTweak/View/MoreView.xaml
@@ -33,7 +33,7 @@
</Grid.ColumnDefinitions>
<Grid Grid.Column="0">
- <UserControl:Card ImageSource="{StaticResource DI_LicenseWindows}" Title="{DynamicResource title_licens_more}" Description="{DynamicResource text_licens_more}" BtnContent="{DynamicResource btntext_licens_more}" ClickButton="BtnLicenseWindows_ClickButton"/>
+ <UserControl:Card ImageSource ="{StaticResource DI_LicenseWindows}" Title="{DynamicResource title_licens_more}" Description="{DynamicResource text_licens_more}" BtnContent="{DynamicResource btntext_licens_more}" ClickButton="BtnLicenseWindows_ClickButton"/>
</Grid>
<Grid Grid.Column="1">
diff --git a/.Source/GTweak/View/MoreView.xaml.cs b/.Source/GTweak/View/MoreView.xaml.cs
index dad10b10..d406d5bd 100644
--- a/.Source/GTweak/View/MoreView.xaml.cs
+++ b/.Source/GTweak/View/MoreView.xaml.cs
@@ -28,23 +28,14 @@ namespace GTweak.View
private async void BtnRestorePoint_ClickButton(object sender, EventArgs e)
{
- if (RecoveryPoint.IsAlreadyPoint() == false)
+ if (await RecoveryPoint.IsAlreadyPointAsync() == false)
{
new ViewNotification().Show("", "info", (string)FindResource("createpoint_notification"));
await Task.Delay(100);
using BackgroundWorker backgroundWorker = new BackgroundWorker();
- backgroundWorker.DoWork += delegate
- {
- try { RecoveryPoint.Create((string)FindResource("textpoint_more")); }
- catch { new ViewNotification().Show("", "warn", (string)FindResource("notsuccessfulpoint_notification")); }
- finally { new ViewNotification(300).Show("", "info", (string)FindResource("successpoint_notification")); };
- };
- backgroundWorker.RunWorkerCompleted += delegate
- {
- new ViewNotification(300).Show("", "info", (string)FindResource("successpoint_notification"));
- };
+ backgroundWorker.DoWork += delegate { RecoveryPoint.Create((string)FindResource("textpoint_more")); };
backgroundWorker.RunWorkerAsync();
}
else
diff --git a/.Source/GTweak/View/PakagesView.xaml.cs b/.Source/GTweak/View/PakagesView.xaml.cs
index 1d93db49..a6492eb4 100644
--- a/.Source/GTweak/View/PakagesView.xaml.cs
+++ b/.Source/GTweak/View/PakagesView.xaml.cs
@@ -48,22 +48,31 @@ namespace GTweak.View
{
case MouseButtonState.Pressed when appImage.Source == (DrawingImage)FindResource("A_DI_" + applicationName):
{
- appImage.Source = (DrawingImage)FindResource("DI_Sandtime");
+ UninstallingPakages.IsAppUnavailable[appImage.Name] = true;
+ UpdateViewStatePakages();
BackgroundQueue backgroundQueue = new BackgroundQueue();
await backgroundQueue.QueueTask(delegate { UninstallingPakages.DeletingPackage(applicationName); });
- backgroundQueue.QueueCompleted(UpdateViewStatePakages);
+
+ await Task.Delay(2000);
+ UpdateViewStatePakages();
+ UninstallingPakages.IsAppUnavailable[appImage.Name] = false;
break;
}
case MouseButtonState.Pressed when appImage.Source == (DrawingImage)FindResource("DA_DI_" + applicationName) && applicationName == "OneDrive":
{
- appImage.Source = (DrawingImage)FindResource("DI_Sandtime");
new ViewNotification().Show("", "info", (string)FindResource("onedrive_notification"));
+ UninstallingPakages.IsAppUnavailable[appImage.Name] = true;
+ UpdateViewStatePakages();
+
BackgroundQueue backgroundQueue = new BackgroundQueue();
- await backgroundQueue.QueueTask(delegate { UninstallingPakages.ResetOneDriveAsync(); });
- backgroundQueue.QueueCompleted(UpdateViewStatePakages);
+ await backgroundQueue.QueueTask(delegate { UninstallingPakages.ResetOneDrive(); });
+
+ await Task.Delay(2000);
+ UpdateViewStatePakages();
+ UninstallingPakages.IsAppUnavailable[appImage.Name] = false;
break;
}
}
diff --git a/.Source/GTweak/Windows/LoadingWindow.xaml.cs b/.Source/GTweak/Windows/LoadingWindow.xaml.cs
index 03405885..0a603d99 100644
--- a/.Source/GTweak/Windows/LoadingWindow.xaml.cs
+++ b/.Source/GTweak/Windows/LoadingWindow.xaml.cs
@@ -26,7 +26,7 @@ namespace GTweak.Windows
{
using BackgroundWorker backgroundWorker = new BackgroundWorker();
backgroundWorker.WorkerReportsProgress = true;
- backgroundWorker.DoWork += BackgroundWorker_DoWorkAsync;
+ backgroundWorker.DoWork += BackgroundWorker_DoWork;
backgroundWorker.ProgressChanged += BackgroundWorker_ProgressChanged;
backgroundWorker.RunWorkerCompleted += async delegate
{
@@ -38,7 +38,7 @@ namespace GTweak.Windows
backgroundWorker.RunWorkerAsync();
}
- private void BackgroundWorker_DoWorkAsync(object sender, DoWorkEventArgs e)
+ private async void BackgroundWorker_DoWork(object sender, DoWorkEventArgs e)
{
for (byte i = 0; i <= 100; i++)
{
@@ -56,6 +56,8 @@ namespace GTweak.Windows
new UninstallingPakages().CheckingForLocalAccount,
new SystemTweaks().ViewNetshState,
new SystemTweaks().ViewBluetoothStatus);
+
+ await SystemData.MonitoringSystem.GetProcessorUsage();
}
private void BackgroundWorker_ProgressChanged(object sender, ProgressChangedEventArgs e)
diff --git a/.Source/GTweak/Windows/MainWindow.xaml b/.Source/GTweak/Windows/MainWindow.xaml
index 10d988e4..d55bda92 100644
--- a/.Source/GTweak/Windows/MainWindow.xaml
+++ b/.Source/GTweak/Windows/MainWindow.xaml
@@ -12,7 +12,7 @@
Title="GTweak"
Height="630" Width="1100"
MaxHeight="630" MaxWidth="1100" MinHeight="630" MinWidth="1100"
- Background="Transparent" ResizeMode="CanMinimize"
+ Background="Transparent"
WindowStyle="None" AllowsTransparency="True"
WindowStartupLocation="CenterScreen"
SnapsToDevicePixels="True" UseLayoutRounding="True"
diff --git a/.Source/GTweak/Windows/MainWindow.xaml.cs b/.Source/GTweak/Windows/MainWindow.xaml.cs
index 6caa4e61..a548837e 100644
--- a/.Source/GTweak/Windows/MainWindow.xaml.cs
+++ b/.Source/GTweak/Windows/MainWindow.xaml.cs
@@ -39,9 +39,10 @@ namespace GTweak
#region Button Title/Animation Window
private void SettingsMenuAnimation()
{
- Parallel.Invoke(() =>
+ Dispatcher.Invoke(() =>
{
Storyboard storyboard = new Storyboard();
+
DoubleAnimation rotateAnimation = new DoubleAnimation()
{
From = 0.0,
@@ -50,7 +51,8 @@ namespace GTweak
EasingFunction = new QuadraticEase(),
Duration = TimeSpan.FromSeconds(2)
};
- DoubleAnimation animation = new DoubleAnimation()
+
+ DoubleAnimation widthAnimation = new DoubleAnimation()
{
From = SettingsMenu.Width != 400 ? 0 : 400,
To = SettingsMenu.Width != 400 ? 400 : 0,
@@ -58,13 +60,16 @@ namespace GTweak
EasingFunction = new QuadraticEase(),
Duration = TimeSpan.FromSeconds(2)
};
- Timeline.SetDesiredFrameRate(animation, 400);
+
Timeline.SetDesiredFrameRate(rotateAnimation, 400);
+ Timeline.SetDesiredFrameRate(widthAnimation, 400);
+
Storyboard.SetTarget(rotateAnimation, ImageSettings);
Storyboard.SetTargetProperty(rotateAnimation, new PropertyPath("(UIElement.RenderTransform).(RotateTransform.Angle)"));
+
storyboard.Children.Add(rotateAnimation);
storyboard.Begin();
- SettingsMenu.BeginAnimation(WidthProperty, animation);
+ SettingsMenu.BeginAnimation(WidthProperty, widthAnimation);
});
}
diff --git a/.Source/GTweak/Windows/NotificationWindow.xaml.cs b/.Source/GTweak/Windows/NotificationWindow.xaml.cs
index f7dc5cb2..8e798a56 100644
--- a/.Source/GTweak/Windows/NotificationWindow.xaml.cs
+++ b/.Source/GTweak/Windows/NotificationWindow.xaml.cs
@@ -83,7 +83,9 @@ namespace GTweak.Windows
}
Rect primaryMonitorArea = SystemParameters.WorkArea;
+
Top = primaryMonitorArea.Bottom - Height - 10;
+ Left = primaryMonitorArea.Right - Width - 10;
DoubleAnimationUsingKeyFrames doubleAnimKeyFrames = new DoubleAnimationUsingKeyFrames();
@@ -111,9 +113,9 @@ namespace GTweak.Windows
Duration = TimeSpan.FromSeconds(0.8)
};
- Left = primaryMonitorArea.Right - Width - 10;
Timeline.SetDesiredFrameRate(doubleAnim, 400);
Timeline.SetDesiredFrameRate(doubleAnimKeyFrames, 400);
+
BeginAnimation(Canvas.LeftProperty, doubleAnimKeyFrames);
BeginAnimation(OpacityProperty, doubleAnim);
}