protected override void OnAttached() { if (Binding != null) { OnBindingPropertyChanged(); } if (string.IsNullOrEmpty(EventName)) { return; } EventHelper.UnsubscribeFromEvent(EventAssociatedObject, ShortEventName); EventHelper.SubscribeToEvent(EventAssociatedObject, ShortEventName); }
protected virtual void OnSourceChanged(object oldSource, object newSource) { RaiseSourceChangedCount++; EventHelper.UnsubscribeFromEvent(oldSource, Event); EventHelper.UnsubscribeFromEvent(oldSource, EventName); EventHelper.SubscribeToEvent(newSource, EventName); EventHelper.SubscribeToEvent(newSource, Event); }
protected virtual void OnSourceChanged(object oldSource, object newSource) { RaiseSourceChangedCount++; #if !SILVERLIGHT && !NETFX_CORE EventHelper.UnsubscribeFromEvent(oldSource, Event); #endif EventHelper.UnsubscribeFromEvent(oldSource, EventName); EventHelper.SubscribeToEvent(newSource, EventName); #if !SILVERLIGHT && !NETFX_CORE EventHelper.SubscribeToEvent(newSource, Event); #endif }