From 3dda11956e3c82548a2326e2f8f41a997885c422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damian=20B=C3=BCchel?= Date: Thu, 31 Mar 2022 11:25:20 +0200 Subject: [PATCH] SEBWIN-559, #378: Removed animated border of runtime window in attempt to fix performance issue in virtualized environments. --- .../ViewModels/RuntimeWindowViewModel.cs | 17 ++--------------- .../Windows/RuntimeWindow.xaml | 18 ------------------ .../Windows/RuntimeWindow.xaml.cs | 10 +--------- .../ViewModels/RuntimeWindowViewModel.cs | 17 ++--------------- .../Windows/RuntimeWindow.xaml | 18 ------------------ .../Windows/RuntimeWindow.xaml.cs | 10 +--------- 6 files changed, 6 insertions(+), 84 deletions(-) diff --git a/SafeExamBrowser.UserInterface.Desktop/ViewModels/RuntimeWindowViewModel.cs b/SafeExamBrowser.UserInterface.Desktop/ViewModels/RuntimeWindowViewModel.cs index bcdaa8df..04beecef 100644 --- a/SafeExamBrowser.UserInterface.Desktop/ViewModels/RuntimeWindowViewModel.cs +++ b/SafeExamBrowser.UserInterface.Desktop/ViewModels/RuntimeWindowViewModel.cs @@ -18,21 +18,8 @@ namespace SafeExamBrowser.UserInterface.Desktop.ViewModels { internal class RuntimeWindowViewModel : ProgressIndicatorViewModel { - private Visibility animatedBorderVisibility, progressBarVisibility; - private TextBlock textBlock; - - public Visibility AnimatedBorderVisibility - { - get - { - return animatedBorderVisibility; - } - set - { - animatedBorderVisibility = value; - OnPropertyChanged(nameof(AnimatedBorderVisibility)); - } - } + private Visibility progressBarVisibility; + private readonly TextBlock textBlock; public Visibility ProgressBarVisibility { diff --git a/SafeExamBrowser.UserInterface.Desktop/Windows/RuntimeWindow.xaml b/SafeExamBrowser.UserInterface.Desktop/Windows/RuntimeWindow.xaml index 8dbd615f..3afd8c5a 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Windows/RuntimeWindow.xaml +++ b/SafeExamBrowser.UserInterface.Desktop/Windows/RuntimeWindow.xaml @@ -15,24 +15,6 @@ - - - - - - - - diff --git a/SafeExamBrowser.UserInterface.Desktop/Windows/RuntimeWindow.xaml.cs b/SafeExamBrowser.UserInterface.Desktop/Windows/RuntimeWindow.xaml.cs index b1391024..671a2e86 100644 --- a/SafeExamBrowser.UserInterface.Desktop/Windows/RuntimeWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Desktop/Windows/RuntimeWindow.xaml.cs @@ -36,14 +36,7 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows public bool ShowProgressBar { - set - { - Dispatcher.Invoke(() => - { - model.AnimatedBorderVisibility = value ? Visibility.Hidden : Visibility.Visible; - model.ProgressBarVisibility = value ? Visibility.Visible : Visibility.Hidden; - }); - } + set => Dispatcher.Invoke(() => model.ProgressBarVisibility = value ? Visibility.Visible : Visibility.Hidden); } public bool TopMost @@ -151,7 +144,6 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows InfoTextBlock.Inlines.Add(new Run(appConfig.ProgramCopyright) { FontSize = 10, Foreground = Brushes.Gray }); model = new RuntimeWindowViewModel(LogTextBlock); - AnimatedBorder.DataContext = model; ProgressBar.DataContext = model; StatusTextBlock.DataContext = model; diff --git a/SafeExamBrowser.UserInterface.Mobile/ViewModels/RuntimeWindowViewModel.cs b/SafeExamBrowser.UserInterface.Mobile/ViewModels/RuntimeWindowViewModel.cs index 2218c371..03b093d2 100644 --- a/SafeExamBrowser.UserInterface.Mobile/ViewModels/RuntimeWindowViewModel.cs +++ b/SafeExamBrowser.UserInterface.Mobile/ViewModels/RuntimeWindowViewModel.cs @@ -18,21 +18,8 @@ namespace SafeExamBrowser.UserInterface.Mobile.ViewModels { internal class RuntimeWindowViewModel : ProgressIndicatorViewModel { - private Visibility animatedBorderVisibility, progressBarVisibility; - private TextBlock textBlock; - - public Visibility AnimatedBorderVisibility - { - get - { - return animatedBorderVisibility; - } - set - { - animatedBorderVisibility = value; - OnPropertyChanged(nameof(AnimatedBorderVisibility)); - } - } + private Visibility progressBarVisibility; + private readonly TextBlock textBlock; public Visibility ProgressBarVisibility { diff --git a/SafeExamBrowser.UserInterface.Mobile/Windows/RuntimeWindow.xaml b/SafeExamBrowser.UserInterface.Mobile/Windows/RuntimeWindow.xaml index ddb41c3c..aca143c3 100644 --- a/SafeExamBrowser.UserInterface.Mobile/Windows/RuntimeWindow.xaml +++ b/SafeExamBrowser.UserInterface.Mobile/Windows/RuntimeWindow.xaml @@ -15,24 +15,6 @@ - - - - - - - - diff --git a/SafeExamBrowser.UserInterface.Mobile/Windows/RuntimeWindow.xaml.cs b/SafeExamBrowser.UserInterface.Mobile/Windows/RuntimeWindow.xaml.cs index b5060a70..c773b0ee 100644 --- a/SafeExamBrowser.UserInterface.Mobile/Windows/RuntimeWindow.xaml.cs +++ b/SafeExamBrowser.UserInterface.Mobile/Windows/RuntimeWindow.xaml.cs @@ -36,14 +36,7 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows public bool ShowProgressBar { - set - { - Dispatcher.Invoke(() => - { - model.AnimatedBorderVisibility = value ? Visibility.Hidden : Visibility.Visible; - model.ProgressBarVisibility = value ? Visibility.Visible : Visibility.Hidden; - }); - } + set => Dispatcher.Invoke(() => model.ProgressBarVisibility = value ? Visibility.Visible : Visibility.Hidden); } public bool TopMost @@ -151,7 +144,6 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows InfoTextBlock.Inlines.Add(new Run(appConfig.ProgramCopyright) { FontSize = 10, Foreground = Brushes.Gray }); model = new RuntimeWindowViewModel(LogTextBlock); - AnimatedBorder.DataContext = model; ProgressBar.DataContext = model; StatusTextBlock.DataContext = model;