private void OnProxyChangedEvent() { try { _suppressChangedEvent = true; if (_indirectProperty != null) { TargetBinding = _indirectProperty.Get(); } } finally { _suppressChangedEvent = false; } }
private void Init() { if (Element == null || PropertyPath == null || ChangedEventPath == null) { _indirectProperty = null; TargetBinding = default(TType); return; } try { if (subscribedDelegate != null) { try { EventProxy.Unsubscribe(subscribedEventElement, subscribedEventInfo, subscribedDelegate); } finally { subscribedDelegate = null; subscribedEventInfo = null; subscribedEventElement = null; } } _indirectProperty = IndirectProperty <TType> .Create(Element, PropertyPath); var evt = ReflectionPathResolver.GetEvent(Element, ChangedEventPath); var dlgt = EventProxy.Subscribe(evt.Item1, evt.Item2, OnProxyChangedEvent); subscribedDelegate = dlgt; subscribedEventInfo = evt.Item2; subscribedEventElement = evt.Item1; TargetBinding = _indirectProperty.Get(); } catch (Exception) { _indirectProperty = null; } }