Ejemplo n.º 1
0
 protected override void WindowClosed()
 {
     this.lastSelectedStructure = this.ViewModel.SelectedStructure?.ProtoStructure;
     this.DataContext           = null;
     this.ViewModel.Dispose();
     this.ViewModel = null;
 }
Ejemplo n.º 2
0
        protected override void WindowOpening()
        {
            if (this.ViewModel is not null)
            {
                // re-opening before closed
                return;
            }

            this.ViewModel = new ViewModelWindowConstructionMenu();
            this.ViewModel.StructureSelectedCallback = this.OnSelectedHandler;
            this.DataContext = this.ViewModel;
            // workaround for NoesisGUI bug (it should go before the DataContext is assigned)
            this.ViewModel.SelectStructure(this.lastSelectedStructure);
        }