public MainWindow(AppInitState state) : this() { app = new AppController(state.MixerState); appPal = new AppPaletteController(); if (!String.IsNullOrWhiteSpace(state.PaletteFileName)) { } app.ResultChanged += SyncAppViewState; appPal.PaletteChanged += SyncAppPalViewState; treeview1.Selection.Changed += (o, e) => { UpdateUI(); }; SyncAppViewState(this, new EventArgs()); SyncAppPalViewState(this, new EventArgs()); }
public MainForm(AppInitState state) : this() { app = new AppController(state.MixerState); appPal = new AppPaletteController(); if (state.PaletteFileName != null) { appPal.FileName = state.PaletteFileName; } app.ResultChanged += SyncAppViewState; appPal.PaletteChanged += SyncAppPalState; // send an initial event manually, because the event has // already been fired when it was initialized, // but without our handler SyncAppViewState(this, new EventArgs()); SyncAppPalState(this, new EventArgs()); }