public ObservableScreenGrids(IScreens screens, WIMPConfiguration configuration) { Screens = screens; Screens.Connect += (_, e) => { e.Screen.PropertyChanged += Screen_PropertyChanged; CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, e.Screen)); }; foreach (var s in Screens) { s.PropertyChanged += Screen_PropertyChanged; } Screens.Disconnect += (_, e) => CollectionChanged?.Invoke(this, new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, e.Screen)); Configuration = configuration; }
public void Save(WIMPConfiguration configuration) { File.WriteAllText(Path, JsonConvert.SerializeObject(configuration)); }