aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2018-07-07 15:02:20 +0300
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2018-07-07 15:02:20 +0300
commit4ca8cee91fb46977b75e8329c18d9b6a4654b12e (patch)
treec2a0473f30d9302f4b8eea21f90106d24ba23461 /Software/Visual_Studio/PPC
parentbed649c7492655c0137237c910b200e053bfa119 (diff)
downloadTango-4ca8cee91fb46977b75e8329c18d9b6a4654b12e.tar.gz
Tango-4ca8cee91fb46977b75e8329c18d9b6a4654b12e.zip
Working on PPC jobs loading performance...
Diffstat (limited to 'Software/Visual_Studio/PPC')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs23
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/AsyncAdornerControl.cs205
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/ExtensionMethods/IListExtensions.cs26
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/ExtensionMethods/ObservableCollectionExtensions.cs53
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs21
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj5
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml16
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml.cs28
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs35
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj8
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml24
14 files changed, 449 insertions, 7 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
index a22e1fdf4..52f2b8f6e 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs
@@ -419,13 +419,28 @@ namespace Tango.PPC.Jobs.ViewModels
SpoolTypes = await _db.SpoolTypes.ToListAsync();
Customers = await _db.Customers.Where(x => x.OrganizationGuid == ApplicationManager.Machine.OrganizationGuid).ToListAsync();
- if (!_check_gamut_thread.IsAlive)
- {
- _check_gamut_thread.Start();
- }
+ //if (!_check_gamut_thread.IsAlive)
+ //{
+ // _check_gamut_thread.Start();
+ //}
+
+ //Job.Segments.ReloadAsyncIdle((current, total) =>
+ //{
+
+ // NotificationProvider.SetGlobalBusyMessage(String.Format("Loading job segment {0}/{1}...", current, total));
+
+ //}, () =>
+ //{
+
+ //});
SegmentsCollectionView = CollectionViewSource.GetDefaultView(Job.Segments);
SegmentsCollectionView.SortDescriptions.Add(new SortDescription(nameof(Segment.SegmentIndex), ListSortDirection.Ascending));
+
+ InvokeUIOnIdle(() =>
+ {
+ NotificationProvider.ReleaseGlobalBusyMessage();
+ });
}
#endregion
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
index 699744d5a..1275248eb 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobsViewVM.cs
@@ -202,7 +202,7 @@ namespace Tango.PPC.Jobs.ViewModels
/// <param name="job">The job.</param>
public async void SelectJob(Job job)
{
- await Task.Delay(300);
+ NotificationProvider.SetGlobalBusyMessage("Loading job...");
await NavigationManager.NavigateTo<JobsModule>(nameof(JobSummeryView));
RaiseMessage(new JobSelectedMessage() { Job = job });
}
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
index a55e5a7d3..0ac903b1d 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml
@@ -70,7 +70,7 @@
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid x:Name="Container" keyboard:KeyboardView.ContainerOffset="40" Grid.RowSpan="2">
- <touch:LightTouchScrollViewer>
+ <touch:LightTouchScrollViewer x:Name="scrollViewer">
<StackPanel Margin="10 60 10 0">
<StackPanel>
<touch:TouchExpander Padding="20 15">
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs
index c3e3ab688..1e6ef30ed 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml.cs
@@ -12,17 +12,23 @@ using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
+using static Tango.SharedUI.Controls.NavigationControl;
namespace Tango.PPC.Jobs.Views
{
/// <summary>
/// Interaction logic for JobView.xaml
/// </summary>
- public partial class JobView : UserControl
+ public partial class JobView : UserControl ,INavigationView
{
public JobView()
{
InitializeComponent();
}
+
+ public void OnNavigated()
+ {
+ scrollViewer.ScrollToTop();
+ }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/AsyncAdornerControl.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/AsyncAdornerControl.cs
new file mode 100644
index 000000000..b20e93ff9
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/AsyncAdornerControl.cs
@@ -0,0 +1,205 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading;
+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.Interop;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Tango.Core.Components;
+
+namespace Tango.PPC.Common.Controls
+{
+ public partial class AsyncAdornerControl : ContentControl
+ {
+ private bool _loaded;
+
+ public enum GWL
+ {
+ ExStyle = -20
+ }
+
+ public enum WS_EX
+ {
+ Transparent = 0x20,
+ Layered = 0x80000
+ }
+
+ public enum LWA
+ {
+ ColorKey = 0x1,
+ Alpha = 0x2
+ }
+
+ [DllImport("user32.dll", EntryPoint = "GetWindowLong")]
+ public static extern int GetWindowLong(IntPtr hWnd, GWL nIndex);
+
+ [DllImport("user32.dll", EntryPoint = "SetWindowLong")]
+ public static extern int SetWindowLong(IntPtr hWnd, GWL nIndex, int dwNewLong);
+
+ [DllImport("user32.dll", EntryPoint = "SetLayeredWindowAttributes")]
+ public static extern bool SetLayeredWindowAttributes(IntPtr hWnd, int crKey, byte alpha, LWA dwFlags);
+
+ private Window _window;
+
+ public AsyncAdornerControl()
+ {
+ Loaded += AsyncAdornerControl_Loaded;
+ LayoutUpdated += AsyncAdornerControl_LayoutUpdated;
+ IsVisibleChanged += AsyncAdornerControl_IsVisibleChanged;
+ }
+
+ private void AsyncAdornerControl_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
+ {
+ if (Visibility == Visibility.Visible)
+ {
+ ShowWindow();
+ }
+ else
+ {
+ HideWindow();
+ }
+ }
+
+ private void AsyncAdornerControl_LayoutUpdated(object sender, EventArgs e)
+ {
+ SyncBounds();
+ }
+
+ public Type ViewType
+ {
+ get { return (Type)GetValue(ViewTypeProperty); }
+ set { SetValue(ViewTypeProperty, value); }
+ }
+ public static readonly DependencyProperty ViewTypeProperty =
+ DependencyProperty.Register("ViewType", typeof(Type), typeof(AsyncAdornerControl), new PropertyMetadata(null));
+
+ protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
+ {
+ base.OnRenderSizeChanged(sizeInfo);
+ SyncBounds();
+ }
+
+ private void AsyncAdornerControl_Loaded(object sender, RoutedEventArgs e)
+ {
+ if (!this.IsInDesignMode())
+ {
+ if (_loaded) return;
+
+ _loaded = true;
+
+ var handle = new WindowInteropHelper(System.Windows.Application.Current.MainWindow).Handle;
+
+ System.Windows.Application.Current.MainWindow.LocationChanged += MainWindow_LocationChanged;
+
+ Visibility v = Visibility;
+ Type type = ViewType;
+
+ var xaml = FrameworkElementSerializer.Serialize(Content as FrameworkElement);
+ object dc = this.DataContext;
+ Content = null;
+
+ Thread thread = new Thread(() =>
+ {
+ _window = new Window();
+ _window.WindowStyle = WindowStyle.None;
+ _window.ResizeMode = ResizeMode.NoResize;
+ _window.ShowInTaskbar = false;
+ _window.AllowsTransparency = true;
+ _window.Background = Brushes.Transparent;
+ _window.WindowStartupLocation = WindowStartupLocation.Manual;
+ SyncBounds();
+
+ if (v != Visibility.Visible)
+ {
+ _window.Opacity = 0;
+ }
+
+ new WindowInteropHelper(_window).Owner = handle;
+
+ _window.ShowActivated = false;
+
+ //FrameworkElement element = Activator.CreateInstance(type) as FrameworkElement;
+
+ var cloned = FrameworkElementSerializer.Deserialize(xaml);
+ cloned.DataContext = dc;
+
+ _window.Content = cloned;
+
+ _window.Show();
+
+ int wl = GetWindowLong(handle, GWL.ExStyle);
+ wl = wl | 0x80000 | 0x20;
+ SetWindowLong(handle, GWL.ExStyle, wl);
+ SetLayeredWindowAttributes(handle, 0, 128, LWA.Alpha);
+
+ SyncBounds();
+
+ System.Windows.Threading.Dispatcher.Run();
+ });
+
+ thread.SetApartmentState(ApartmentState.STA);
+ thread.IsBackground = true;
+ thread.Start();
+ }
+ }
+
+ private void MainWindow_LocationChanged(object sender, EventArgs e)
+ {
+ SyncBounds();
+ }
+
+ private void SyncBounds()
+ {
+ if (_window != null)
+ {
+ this.BeginInvoke(() =>
+ {
+ Point location = PointToScreen(new Point(0, 0));
+ Size size = new Size(ActualWidth, ActualHeight);
+
+ _window.BeginInvoke(() =>
+ {
+ _window.Top = location.Y;
+ _window.Left = location.X;
+ _window.Width = size.Width;
+ _window.Height = size.Height;
+ });
+ });
+ }
+ }
+
+ private void HideWindow()
+ {
+ if (_window != null)
+ {
+ _window.BeginInvoke(() =>
+ {
+ _window.Hide();
+ });
+ }
+ }
+
+ private void ShowWindow()
+ {
+ if (_window != null)
+ {
+ _window.BeginInvoke(() =>
+ {
+ _window.Opacity = 1;
+ _window.Show();
+ });
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/ExtensionMethods/IListExtensions.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/ExtensionMethods/IListExtensions.cs
new file mode 100644
index 000000000..fdf07ccff
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/ExtensionMethods/IListExtensions.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+
+public static class IListExtensions
+{
+ public static IList<T> ToListAsyncIdle<T>(this IList<T> source)
+ {
+ var copy = source.ToList();
+ IList<T> result = new List<T>();
+
+ foreach (var item in copy)
+ {
+ Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+ {
+ result.Add(item);
+ }), DispatcherPriority.ContextIdle);
+ }
+
+ return result;
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/ExtensionMethods/ObservableCollectionExtensions.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/ExtensionMethods/ObservableCollectionExtensions.cs
new file mode 100644
index 000000000..c539273d9
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/ExtensionMethods/ObservableCollectionExtensions.cs
@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+
+public static class ObservableCollectionExtensions
+{
+ public static ObservableCollection<T> ToObservableCollectionAsyncIdle<T>(this ObservableCollection<T> source)
+ {
+ var copy = source.ToList();
+ ObservableCollection<T> result = new ObservableCollection<T>();
+
+ foreach (var item in copy)
+ {
+ Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+ {
+ result.Add(item);
+ }), DispatcherPriority.ContextIdle);
+ }
+
+ return result;
+ }
+
+ public static void ReloadAsyncIdle<T>(this ObservableCollection<T> source, Action<int, int> onProgress, Action onComplete = null)
+ {
+ var copy = source.ToList();
+ source.Clear();
+
+ int count = copy.Count;
+ int completed = 0;
+
+ foreach (var item in copy)
+ {
+ Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+ {
+ source.Add(item);
+ completed++;
+
+ onProgress?.Invoke(completed, count);
+
+ if (completed == count)
+ {
+ onComplete?.Invoke();
+ }
+ }), DispatcherPriority.ContextIdle);
+ }
+ }
+}
+
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
index 96de08447..f7fb67a19 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Notifications/INotificationProvider.cs
@@ -128,5 +128,26 @@ namespace Tango.PPC.Common.Notifications
/// Gets the pop notification command.
/// </summary>
RelayCommand<NotificationItem> PopNotificationCommand { get; }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is in global busy state.
+ /// </summary>
+ bool IsInGlobalBusyState { get; }
+
+ /// <summary>
+ /// Sets the global busy message.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ void SetGlobalBusyMessage(String message);
+
+ /// <summary>
+ /// Releases the global busy message.
+ /// </summary>
+ void ReleaseGlobalBusyMessage();
+
+ /// <summary>
+ /// Gets the current global busy message.
+ /// </summary>
+ String GlobalBusyMessage { get; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
index 98210a76f..192658560 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
@@ -75,6 +75,8 @@
<HintPath>..\..\packages\System.Data.SQLite.Linq.1.0.108.0\lib\net46\System.Data.SQLite.Linq.dll</HintPath>
<Private>True</Private>
</Reference>
+ <Reference Include="System.Drawing" />
+ <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
@@ -92,9 +94,12 @@
<Compile Include="..\..\Versioning\PPC.cs">
<Link>PPC.cs</Link>
</Compile>
+ <Compile Include="Controls\AsyncAdornerControl.cs" />
<Compile Include="Controls\TwineCatalogControl.xaml.cs">
<DependentUpon>TwineCatalogControl.xaml</DependentUpon>
</Compile>
+ <Compile Include="ExtensionMethods\IListExtensions.cs" />
+ <Compile Include="ExtensionMethods\ObservableCollectionExtensions.cs" />
<Compile Include="IPPCView.cs" />
<Compile Include="Modules\IPPCModuleLoader.cs" />
<Compile Include="Navigation\INavigationBlocker.cs" />
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml
new file mode 100644
index 000000000..5b07e1fa2
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml
@@ -0,0 +1,16 @@
+<UserControl x:Class="Tango.PPC.UI.Controls.HeaderLoadingControl"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:local="clr-namespace:Tango.PPC.UI.Controls"
+ mc:Ignorable="d"
+ d:DesignHeight="80" d:DesignWidth="300" IsHitTestVisible="False">
+ <Grid>
+ <StackPanel Orientation="Horizontal" Margin="20 0 0 0">
+ <touch:TouchBusyIndicator IsIndeterminate="True" Width="50" Height="50" />
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0">Loading...</TextBlock>
+ </StackPanel>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml.cs
new file mode 100644
index 000000000..540e829c9
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Controls/HeaderLoadingControl.xaml.cs
@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+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.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.PPC.UI.Controls
+{
+ /// <summary>
+ /// Interaction logic for HeaderLoadingControl.xaml
+ /// </summary>
+ public partial class HeaderLoadingControl : UserControl
+ {
+ public HeaderLoadingControl()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
index ae777839b..aaa5a9cf3 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Notifications/DefaultNotificationProvider.cs
@@ -386,5 +386,40 @@ namespace Tango.PPC.UI.Notifications
{
return ShowDialog<T>(Activator.CreateInstance<T>());
}
+
+ /// <summary>
+ /// Sets the global busy message.
+ /// </summary>
+ /// <param name="message">The message.</param>
+ public void SetGlobalBusyMessage(string message)
+ {
+ GlobalBusyMessage = message;
+ IsInGlobalBusyState = true;
+
+ RaisePropertyChanged(nameof(IsInGlobalBusyState));
+ RaisePropertyChanged(nameof(GlobalBusyMessage));
+ }
+
+ /// <summary>
+ /// Releases the global busy message.
+ /// </summary>
+ public void ReleaseGlobalBusyMessage()
+ {
+ GlobalBusyMessage = null;
+ IsInGlobalBusyState = false;
+
+ RaisePropertyChanged(nameof(IsInGlobalBusyState));
+ RaisePropertyChanged(nameof(GlobalBusyMessage));
+ }
+
+ /// <summary>
+ /// Gets the current global busy message.
+ /// </summary>
+ public string GlobalBusyMessage { get; private set; }
+
+ /// <summary>
+ /// Gets a value indicating whether this instance is in global busy state.
+ /// </summary>
+ public bool IsInGlobalBusyState { get; private set; }
}
}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
index d2763510a..eaf53b993 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Tango.PPC.UI.csproj
@@ -101,6 +101,7 @@
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
+ <Reference Include="WindowsFormsIntegration" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
@@ -111,6 +112,9 @@
<Link>PPC.cs</Link>
</Compile>
<Compile Include="Authentication\DefaultAuthenticationProvider.cs" />
+ <Compile Include="Controls\HeaderLoadingControl.xaml.cs">
+ <DependentUpon>HeaderLoadingControl.xaml</DependentUpon>
+ </Compile>
<Compile Include="Converters\NotificationItemConverter.cs" />
<Compile Include="Modules\DefaultStudioModuleLoader.cs" />
<Compile Include="Navigation\DefaultNavigationManager.cs" />
@@ -140,6 +144,10 @@
<Compile Include="Views\MainView.xaml.cs">
<DependentUpon>MainView.xaml</DependentUpon>
</Compile>
+ <Page Include="Controls\HeaderLoadingControl.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
index c7d019981..7d170d04f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/Views/LayoutView.xaml
@@ -4,12 +4,14 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Tango.PPC.UI.Views"
+ xmlns:localControls="clr-namespace:Tango.PPC.UI.Controls"
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
xmlns:fa="http://schemas.fontawesome.io/icons/"
xmlns:vm="clr-namespace:Tango.PPC.UI.ViewModels"
xmlns:global="clr-namespace:Tango.PPC.UI"
xmlns:localConverters="clr-namespace:Tango.PPC.UI.Converters"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:commonControls="clr-namespace:Tango.PPC.Common.Controls;assembly=Tango.PPC.Common"
xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
xmlns:keyboard="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch"
mc:Ignorable="d"
@@ -110,6 +112,28 @@
</Grid>
<Grid>
<!--External Header Content Here-->
+ <commonControls:AsyncAdornerControl>
+ <commonControls:AsyncAdornerControl.Style>
+ <Style TargetType="commonControls:AsyncAdornerControl">
+ <Setter Property="Visibility" Value="Hidden"></Setter>
+ <Style.Triggers>
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding NotificationProvider.IsInGlobalBusyState}" Value="True" />
+ <Condition Binding="{Binding IsMenuOpened}" Value="False" />
+ </MultiDataTrigger.Conditions>
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </MultiDataTrigger>
+ </Style.Triggers>
+ </Style>
+ </commonControls:AsyncAdornerControl.Style>
+ <Grid>
+ <StackPanel Orientation="Horizontal">
+ <touch:TouchBusyIndicator Width="50" Height="50" IsIndeterminate="True" />
+ <TextBlock VerticalAlignment="Center" Margin="10 0 0 0" FontSize="20" Text="{Binding NotificationProvider.GlobalBusyMessage}"></TextBlock>
+ </StackPanel>
+ </Grid>
+ </commonControls:AsyncAdornerControl>
</Grid>
</DockPanel>
</Border>