/// <summary> /// Escucha el evento <c>Property.PropertyChanged</c>. /// </summary> private void Property_PropertyChanged(object sender, PropertyChangedExEventArgs args) { switch (args.PropertyName) { case Property.ENABLED: { this.TSItem.Enabled = this.Item.Enabled; break; } case Property.EDITABLE: { break; } case Property.VALUE: { this.actualizando.Do( () => { this.UpdateControl(); }); break; } } }
protected virtual void OnPropertyChanged(PropertyChangedExEventArgs args) { PropertyChangedExEventHandler handler = this.PropertyChanged; if (handler != null) { handler(this, args); } }
/// <summary> /// Escucha el evento <c>IAction.PropertyChanged</c>. /// </summary> private void Action_PropertyChanged(object source, PropertyChangedExEventArgs args) { switch (args.PropertyName) { case Essence.View.Models.Action.ENABLED: { this.TSItem.Enabled = this.Item.Enabled; break; } } }
private void LightEvent_PropertyChanged(object sender, PropertyChangedExEventArgs e) { ILightEvent lightEvent = (ILightEvent)sender; if (e.PropertyName.Equals(nameof(LightEventConfig.Type))) { LightEventType old = (LightEventType)e.OldValue; LightEventType newVal = (LightEventType)e.NewValue; if (!old.Equals(newVal)) { InsertLightEvent(lightEvent, old); } } }
private void FormModel_PropertyChanged(object sender, PropertyChangedExEventArgs args) { switch (args.PropertyName) { case ReflectionFormModel.FORM_TYPE: { break; } case ReflectionFormModel.FORM_OBJECT: { break; } } this.Form2Control(args.PropertyName); }
/// <summary> /// Escucha el evento <c>Property.PropertyChanged</c>. /// </summary> private void Property_PropertyChanged(object sender, PropertyChangedExEventArgs args) { switch (args.PropertyName) { case AbsComponentUI.NAME_UI: case AbsComponentUI.DESCRIPTION_UI: case AbsComponentUI.ICON_UI: { this.tsItem.Text = this.Item.NameUI; this.tsItem.ToolTipText = this.Item.DescriptionUI; if (this.Item.IconUI != null) { this.tsItem.Image = this.Item.IconUI.ToImage(this.context.CurrentIconSize); } else if (this.context.CurrentDisplayStyle == ToolStripItemDisplayStyle.Image) { this.tsItem.Image = MainResources.icon_not_found.ToImage(this.context.CurrentIconSize); } break; } } }
private void _ItemPropertyChanged(object sender, PropertyChangedEventArgs e) { if (e.PropertyName == nameof(ItemViewModel.Value)) { ItemViewModel itemModel = (ItemViewModel)sender; PropertyChangedExEventArgs <string> exArgs = (PropertyChangedExEventArgs <string>)e; if (exArgs.OldValue != null) { _valueToModel.Remove(exArgs.OldValue); } if (itemModel.Value != null) { if (_valueToModel.TryGetValue( itemModel.Value, out ItemViewModel otherModel)) { otherModel.Value = null; } _valueToModel[itemModel.Value] = itemModel; } } }
void INotifyPropertyChangedEx_Helper.NotifyPropertyChanged(PropertyChangedExEventArgs args) { this.OnPropertyChanged(args); }