Maintain state across ReloadAll
- Issue MatterHackers/MCCentral#2561 Configure -> Printer should survive ReloadAll
This commit is contained in:
parent
13b1051eb2
commit
38666e89c4
7 changed files with 89 additions and 26 deletions
|
|
@ -180,25 +180,12 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
|
|||
}));
|
||||
}
|
||||
},
|
||||
new NamedAction()
|
||||
new NamedBoolAction()
|
||||
{
|
||||
Title = "Configure Printer".Localize(),
|
||||
Action = () =>
|
||||
{
|
||||
var partTabPage = this.Parents<PartTabPage>().FirstOrDefault();
|
||||
var dockingTabControl = partTabPage.FindNamedChildRecursive("DockingTabControl") as DockingTabControl;
|
||||
printer.ViewState.SliceSettingsTabIndex = 3;
|
||||
|
||||
dockingTabControl.AddPage(
|
||||
"Printer",
|
||||
new ConfigurePrinterWidget(partTabPage, theme)
|
||||
{
|
||||
BackgroundColor = ActiveTheme.Instance.PrimaryBackgroundColor,
|
||||
Padding = new BorderDouble(top: 10),
|
||||
HAnchor = HAnchor.Stretch,
|
||||
VAnchor = VAnchor.Stretch,
|
||||
});
|
||||
}
|
||||
Action = () => { },
|
||||
GetIsActive = () => printer.ViewState.ConfigurePrinterVisible,
|
||||
SetIsActive = (value) => printer.ViewState.ConfigurePrinterVisible = value
|
||||
},
|
||||
new NamedAction() { Title = "----" },
|
||||
new NamedAction()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue