diff --git a/ENI2/App.xaml.cs b/ENI2/App.xaml.cs index f8cc4b82..c64a3b6e 100644 --- a/ENI2/App.xaml.cs +++ b/ENI2/App.xaml.cs @@ -60,7 +60,10 @@ namespace ENI2 ResetSplashCreated.WaitOne(); - base.OnStartup(e); + base.OnStartup(e); + + // set connectnion string to async loader + DBManagerAsync.ConnectionString = ENI2.Properties.Settings.Default.ConnectionString; // initialize static / localized lookups from sqlite database 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 new file mode 100644 index 00000000..c45a235f --- /dev/null +++ b/ENI2/Controls/MaerskListControl.xaml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +