1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using Dm.filter;
- using ProximaAnalizer.PublicEvent;
- using System.Text;
- 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 ProximaAnalizer.Views;
- /// <summary>
- /// Interaction logic for MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow(IEventAggregator eventAggregator, IRegionManager regionManager)
- {
- InitializeComponent();
- this._eventAggregator = eventAggregator;
- this._eventAggregator.GetEvent<WindowSwitch>().Subscribe(SwitchWindow);
- this.Loaded += MainWindow_Loaded;
- this._regionManager = regionManager;
- }
- private readonly IRegionManager _regionManager;
- private readonly IEventAggregator _eventAggregator;
- private void MainWindow_Loaded(object sender, RoutedEventArgs e)
- {
- this.WindowStyle = WindowStyle.None;
- this.ResizeMode = ResizeMode.NoResize;
- this.Content = new Loading();
- }
- private object? Summary;
- private object? RecipeNavi;
- private void SwitchWindow()
- {
- switch (this._eventAggregator.GetEvent<WindowSwitch>().Page)
- {
- case Pages.Loading:
- Width = 800;
- Height = 160;
- break;
- case Pages.RecipeStepNavi:
- Width = 1280;
- Height = 800;
- this.WindowStyle = WindowStyle.ThreeDBorderWindow;
- this.ResizeMode = ResizeMode.CanResize;
- this.RecipeNavi ??= new RecipeStepNavi();
- this.Content = this.RecipeNavi;
- break;
- case Pages.MainWindow:
- Width = 1280;
- Height = 800;
- this.WindowStyle = WindowStyle.ThreeDBorderWindow;
- this.ResizeMode = ResizeMode.CanResize;
- this.Summary ??= new Summary();
- this.Content = this.Summary;
- _regionManager.RequestNavigate("MainRegion", "DBInfoTrace");
- break;
- default:
- break;
- }
- }
- }
|