private void _engine_FixedTimeEventOperation(object sender, CollectionOperationEventArgs <IEvent> e) { if (e.Operation == CollectionOperation.Add) { _fixedTimeEvents.Add(new EventPanelAutoStartEventViewmodel(e.Item)); } if (e.Operation == CollectionOperation.Remove) { _fixedTimeEvents.Remove(_fixedTimeEvents.FirstOrDefault(evm => evm.Event == e.Item)); } }
protected virtual void OnSubeventChanged(object o, CollectionOperationEventArgs <IEvent> e) { Debug.WriteLine(e.Item, $"OnSubEventChanged {e.Operation}"); Application.Current.Dispatcher.BeginInvoke((Action) delegate() { if (e.Operation == TCollectionOperation.Remove && !IsExpanded && HasDummyChild && _event.SubEventsCount == 0) { Childrens.Remove(DummyChild); } if (e.Operation == TCollectionOperation.Insert && !IsExpanded && !HasDummyChild && _event.SubEventsCount > 0) { Childrens.Add(DummyChild); } }); }
protected override void OnSubeventChanged(object o, CollectionOperationEventArgs <IEvent> e) { base.OnSubeventChanged(o, e); switch (e.Item.Layer) { case VideoLayer.CG1: NotifyPropertyChanged(nameof(HasSubItemOnLayer1)); NotifyPropertyChanged(nameof(Layer1SubItemMediaName)); break; case VideoLayer.CG2: NotifyPropertyChanged(nameof(HasSubItemOnLayer2)); NotifyPropertyChanged(nameof(Layer2SubItemMediaName)); break; case VideoLayer.CG3: NotifyPropertyChanged(nameof(HasSubItemOnLayer3)); NotifyPropertyChanged(nameof(Layer3SubItemMediaName)); break; } }
private void _subeventChanged(CollectionOperationEventArgs <IEvent> e) { object subEvents; if (Properties.TryGetValue(nameof(SubEvents), out subEvents)) { var list = subEvents as IList <IEvent>; if (list != null) { if (e.Operation == TCollectionOperation.Insert) { list.Add(e.Item); } else { list.Remove(e.Item); } SubEventsCount = list.Count; NotifyPropertyChanged(nameof(SubEventsCount)); } } }
private void AuthenticationService_GroupsOperation(object sender, CollectionOperationEventArgs <IGroup> e) { Application.Current.Dispatcher.BeginInvoke((Action) delegate { var vm = Groups.FirstOrDefault(u => u.Model == e.Item); if (e.Operation == CollectionOperation.Add) { if (vm == null) { vm = new GroupViewmodel(e.Item); vm.Load(); Groups.Add(vm); } } else { if (vm != null) { Groups.Remove(vm); vm.Dispose(); } } }); }
protected override void OnSubeventChanged(object o, CollectionOperationEventArgs <IEvent> e) { base.OnSubeventChanged(o, e); InvalidateRequerySuggested(); }
private void Groups_AcoOperation(object sender, CollectionOperationEventArgs <IGroup> e) { GroupsOperation?.Invoke(this, new CollectionOperationEventArgs <IGroup>(e.Item, e.Operation)); NotifyPropertyChanged(nameof(Groups)); }
private void Users_AcoOperation(object sender, CollectionOperationEventArgs <User> e) { UsersOperation?.Invoke(this, new CollectionOperationEventArgs <IUser>(e.Item, e.Operation)); NotifyPropertyChanged(nameof(Users)); }
private void _onSubeventChanged(object o, CollectionOperationEventArgs<Event> e) { if (((o as Event).EventType == TEventType.Live || (o as Event).EventType == TEventType.Movie) && (e.Item.EventType == TEventType.StillImage || e.Item.EventType == TEventType.AnimationFlash)) { switch (e.Item.Layer) { case VideoLayer.CG1: NotifyPropertyChanged("HasSubItemOnLayer1"); NotifyPropertyChanged("Layer1SubItemMediaName"); break; case VideoLayer.CG2: NotifyPropertyChanged("HasSubItemOnLayer2"); NotifyPropertyChanged("Layer2SubItemMediaName"); break; case VideoLayer.CG3: NotifyPropertyChanged("HasSubItemOnLayer3"); NotifyPropertyChanged("Layer3SubItemMediaName"); break; } } Application.Current.Dispatcher.BeginInvoke((Action)delegate() { if (e.Operation == TCollectionOperation.Remove && HasDummyChild && _event.SubEvents.Count == 0) Childrens.Remove(DummyChild); }); }
private void _onSubeventChanged(object o, CollectionOperationEventArgs <IEvent> e) { }
protected override void OnSubeventChanged(object o, CollectionOperationEventArgs <IEvent> e) { base.OnSubeventChanged(o, e); NotifyPropertyChanged(nameof(ChildrenCount)); }
private void _onSourceCollectionOperation(object o, CollectionOperationEventArgs<Template> e) { Application.Current.Dispatcher.BeginInvoke((Action)delegate() { if (e.Operation == TCollectionOperation.Insert) _items.Add(new TemplateViewmodel(e.Item, this)); if (e.Operation == TCollectionOperation.Remove) { var itemToRemove = _items.FirstOrDefault(i => i.Template == e.Item); if (itemToRemove != null) _items.Remove(itemToRemove); } }, null); }
private void OnEngineRunningEventsOperation(object o, CollectionOperationEventArgs<Event> e) { Application.Current.Dispatcher.BeginInvoke((Action)delegate() { if (e.Operation == TCollectionOperation.Insert) _runningEvents.Add(e.Item); else _runningEvents.Remove(e.Item); }); }