diff --git a/Azaion.Suite/MainSuite.xaml b/Azaion.Suite/MainSuite.xaml index dd1ca2f..6ebe207 100644 --- a/Azaion.Suite/MainSuite.xaml +++ b/Azaion.Suite/MainSuite.xaml @@ -4,12 +4,19 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" mc:Ignorable="d" - Title="Azaion Оператор" Height="450" Width="800"> - - - + Title="Azaion Оператор" Height="100" Width="200" + WindowStyle="None" + ResizeMode="NoResize" + Top="0" + Topmost="True" + > + + + + + + + + diff --git a/Azaion.Suite/MainSuite.xaml.cs b/Azaion.Suite/MainSuite.xaml.cs index 0122268..bc9ec5f 100644 --- a/Azaion.Suite/MainSuite.xaml.cs +++ b/Azaion.Suite/MainSuite.xaml.cs @@ -6,7 +6,6 @@ using System.Windows.Media; using Azaion.Annotator.Extensions; using Azaion.Common.DTO; using Azaion.Common.DTO.Config; -using Azaion.Dataset; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Options; using SharpVectors.Converters; @@ -34,6 +33,7 @@ public partial class MainSuite SizeChanged += async (_, _) => await SaveUserSettings(); LocationChanged += async (_, _) => await SaveUserSettings(); StateChanged += async (_, _) => await SaveUserSettings(); + Left = SystemParameters.WorkArea.Width - Width - 150; } private void OnLoaded(object sender, RoutedEventArgs e) @@ -45,47 +45,40 @@ public partial class MainSuite if (!Directory.Exists(_appConfig.DirectoriesConfig.ResultsDirectory)) Directory.CreateDirectory(_appConfig.DirectoriesConfig.ResultsDirectory); - - Left = _appConfig.WindowConfig.WindowLocation.X; - Top = _appConfig.WindowConfig.WindowLocation.Y; - Width = _appConfig.WindowConfig.WindowSize.Width; - Height = _appConfig.WindowConfig.WindowSize.Height; - - if (_appConfig.WindowConfig.FullScreen) - WindowState = WindowState.Maximized; - foreach (var azaionModule in _modules) { - var window = (_sp.GetRequiredService(azaionModule.MainWindowType) as Window)!; - window.Height = 0; - window.Width = 0; - window.Show(); - window.Hide(); - _openedWindows.Add(window); - var icon = new SvgViewbox + var lvItem = new ListViewItem { - SvgSource = azaionModule.SvgIcon, - Width = 32, - Height = 32, - Margin = new Thickness(0, 0, 10, 0) - }; - var text = new TextBlock - { - Text = azaionModule.Name, - Foreground = Brushes.White, - HorizontalAlignment = HorizontalAlignment.Center, - Background = Brushes.Black - }; - var tabItem = new TabItem - { - Header = new StackPanel { Children = { icon, text } }, - Content = window.Content, + Content = new StackPanel { Children = + { + new SvgViewbox + { + SvgSource = azaionModule.SvgIcon, + Width = 32, + Height = 32, + Margin = new Thickness(0, 0, 10, 0) + }, + new TextBlock + { + Text = azaionModule.Name, + Foreground = Brushes.White, + HorizontalAlignment = HorizontalAlignment.Center, + Background = Brushes.Black + } + } }, Background = Brushes.Black, Foreground = Brushes.White, Cursor = Cursors.Hand, - Tag = azaionModule.WindowEnum + Tag = azaionModule }; - MainTabControl.Items.Add(tabItem); + lvItem.MouseUp += (sender, _) => + { + var module = ((sender as ListViewItem)!.Tag as IAzaionModule)!; + var window = (_sp.GetRequiredService(module.MainWindowType) as Window)!; + _openedWindows.Add(window); + window.Show(); + }; + ListView.Items.Add(lvItem); } }