|
@@ -16,6 +16,7 @@ using System.Windows.Controls;
|
|
|
using System.Windows.Data;
|
|
|
using System.Windows.Input;
|
|
|
using System.Windows.Media;
|
|
|
+using System.Windows.Media.Animation;
|
|
|
using System.Windows.Media.Imaging;
|
|
|
using System.Windows.Threading;
|
|
|
using InABox.Clients;
|
|
@@ -350,7 +351,9 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
private readonly Grid Layout;
|
|
|
private readonly Label Loading;
|
|
|
-
|
|
|
+
|
|
|
+ private DoubleAnimation LoadingFader = new DoubleAnimation(1d, 0.2d, new Duration(TimeSpan.FromSeconds(2))) { AutoReverse = true };
|
|
|
+
|
|
|
protected Dictionary<string, CoreTable> Lookups = new();
|
|
|
//private readonly Button MultiEdit;
|
|
|
private readonly Button Paste;
|
|
@@ -495,8 +498,15 @@ namespace InABox.DynamicGrid
|
|
|
Loading.SetValue(Panel.ZIndexProperty, 999);
|
|
|
Loading.SetValue(Grid.RowProperty, 1);
|
|
|
Loading.FontSize = 14.0F;
|
|
|
- Loading.Tag = new DispatcherTimer { Interval = TimeSpan.FromMilliseconds(50) };
|
|
|
-
|
|
|
+ LoadingFader.Completed += (sender, args) =>
|
|
|
+ {
|
|
|
+ if (Loading.Visibility == Visibility.Visible)
|
|
|
+ {
|
|
|
+ Logger.Send(LogType.Information, this.GetType().EntityName().Split(".").Last(), "Loading Fader Restarting");
|
|
|
+ Loading.BeginAnimation(Label.OpacityProperty, LoadingFader);
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
Help = CreateButton(Wpf.Resources.help.AsBitmapImage(Color.White));
|
|
|
Help.Margin = new Thickness(0, 2, 2, 0);
|
|
|
Help.SetValue(DockPanel.DockProperty, Dock.Right);
|
|
@@ -1897,31 +1907,8 @@ namespace InABox.DynamicGrid
|
|
|
var cursor = UseWaitCursor ? new WaitCursor() : null;
|
|
|
|
|
|
Loading.Visibility = Visibility.Visible;
|
|
|
- double opacity = 1.0F;
|
|
|
- var bFading = true;
|
|
|
- var timer = (DispatcherTimer)Loading.Tag;
|
|
|
- Loading.Tag = timer;
|
|
|
- timer.Tick += (o, e) =>
|
|
|
- {
|
|
|
- if (bFading)
|
|
|
- opacity -= 0.05F;
|
|
|
- else
|
|
|
- opacity += 0.05F;
|
|
|
- if (opacity >= 1.0F)
|
|
|
- {
|
|
|
- opacity = 1.0F;
|
|
|
- bFading = true;
|
|
|
- }
|
|
|
- else if (opacity <= 0.2F)
|
|
|
- {
|
|
|
- opacity = 0.2F;
|
|
|
- bFading = false;
|
|
|
- }
|
|
|
-
|
|
|
- Loading.Opacity = opacity;
|
|
|
- };
|
|
|
- timer.IsEnabled = true;
|
|
|
-
|
|
|
+ Loading.BeginAnimation(Label.OpacityProperty, LoadingFader);
|
|
|
+
|
|
|
bRefreshing = true;
|
|
|
|
|
|
// Yo, please don't remove this.
|
|
@@ -1981,6 +1968,9 @@ namespace InABox.DynamicGrid
|
|
|
{
|
|
|
ProcessData(reloadcolumns, reloaddata);
|
|
|
DoAfterReload();
|
|
|
+
|
|
|
+ Loading.BeginAnimation(Label.OpacityProperty, null);
|
|
|
+ Loading.Visibility = Visibility.Collapsed;
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -2156,9 +2146,8 @@ namespace InABox.DynamicGrid
|
|
|
|
|
|
UpdateRecordCount();
|
|
|
|
|
|
+ Loading.BeginAnimation(Label.OpacityProperty, null);
|
|
|
Loading.Visibility = Visibility.Collapsed;
|
|
|
- var timer = (DispatcherTimer)Loading.Tag;
|
|
|
- timer.IsEnabled = false;
|
|
|
}
|
|
|
|
|
|
private void UpdateRecordCount()
|