From 5f28c8c7ea6cac1cf824cca45c51f06783ade5f5 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Sun, 5 Feb 2023 11:14:07 +0100 Subject: [PATCH] wip --- ENI2/Controls/BusyControl.xaml | 14 ++++++ ENI2/Controls/BusyControl.xaml.cs | 44 ++++++++++++++++ ENI2/Controls/MaerskListControl.xaml | 21 +++++--- ENI2/Controls/MaerskListControl.xaml.cs | 35 +++++++++---- ENI2/ENI2.csproj | 7 +++ ENI2/EditControls/CompareExcelDialog.xaml.cs | 2 +- ENI2/Util/UIHelper.cs | 53 ++++++++++++++++++-- bsmd.database/DBManager.cs | 2 +- 8 files changed, 154 insertions(+), 24 deletions(-) create mode 100644 ENI2/Controls/BusyControl.xaml create mode 100644 ENI2/Controls/BusyControl.xaml.cs diff --git a/ENI2/Controls/BusyControl.xaml b/ENI2/Controls/BusyControl.xaml new file mode 100644 index 00000000..83b0c937 --- /dev/null +++ b/ENI2/Controls/BusyControl.xaml @@ -0,0 +1,14 @@ + + + + + diff --git a/ENI2/Controls/BusyControl.xaml.cs b/ENI2/Controls/BusyControl.xaml.cs new file mode 100644 index 00000000..e840a1fc --- /dev/null +++ b/ENI2/Controls/BusyControl.xaml.cs @@ -0,0 +1,44 @@ +// Copyright (c) 2023- schick Informatik +// +// Description: Idea to have a simple control that shows if the application is busy or not using a simple icon +// that will be set according to a state +// + +using ENI2.Util; +using System.Windows.Controls; + +namespace ENI2.Controls +{ + /// + /// Interaction logic for BusyControl.xaml + /// + public partial class BusyControl : UserControl + { + UIHelper.BusyStateEnum _busyState = UIHelper.BusyStateEnum.NEUTRAL; + + public BusyControl() + { + InitializeComponent(); + } + + public UIHelper.BusyStateEnum BusyState + { + set + { + _busyState = value; + //Dispatcher.Invoke(() => + //{ + switch (_busyState) + { + case UIHelper.BusyStateEnum.NEUTRAL: imageBall.Source = Properties.Resources.bullet_ball_grey.CreateBitmapSource(); break; + case UIHelper.BusyStateEnum.BUSY: imageBall.Source = Properties.Resources.bullet_ball_yellow.CreateBitmapSource(); break; + case UIHelper.BusyStateEnum.FAIL: imageBall.Source = Properties.Resources.bullet_ball_red.CreateBitmapSource(); break; + case UIHelper.BusyStateEnum.SUCCESS: imageBall.Source = Properties.Resources.bullet_ball_green.CreateBitmapSource(); break; + } + //}); + } + + get => _busyState; + } + } +} diff --git a/ENI2/Controls/MaerskListControl.xaml b/ENI2/Controls/MaerskListControl.xaml index b2bde931..b6ab6887 100644 --- a/ENI2/Controls/MaerskListControl.xaml +++ b/ENI2/Controls/MaerskListControl.xaml @@ -24,12 +24,21 @@ - -