Convert static SettingChanged event to instance based
issue: MatterHackers/MCCentral#4551
This commit is contained in:
parent
b38abfaad4
commit
6405dad7ac
23 changed files with 111 additions and 87 deletions
|
|
@ -294,7 +294,8 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
valueField.Name = "Temperature Input";
|
||||
|
||||
var settingsRow = temperatureRow.DescendantsAndSelf<SliceSettingsRow>().FirstOrDefault();
|
||||
PrinterSettings.SettingChanged.RegisterEvent((s, e) =>
|
||||
|
||||
void SettingChanged(object s, EventArgs e)
|
||||
{
|
||||
if (e is StringEventArgs stringEvent)
|
||||
{
|
||||
|
|
@ -325,8 +326,10 @@ namespace MatterHackers.MatterControl.ActionBar
|
|||
|
||||
settingsRow.UpdateStyle();
|
||||
}
|
||||
};
|
||||
}, ref unregisterEvents);
|
||||
}
|
||||
}
|
||||
printer.Settings.SettingChanged += SettingChanged;
|
||||
printer.Disposed -= SettingChanged;
|
||||
|
||||
container.AddChild(graph);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue