private static void OnTombstonerChanged(FrameworkElement obj, Epitaph oldValue, Epitaph newValue) { if (DesignerProperties.IsInDesignTool) { return; } if (oldValue != null) { oldValue.Parent = null; } if (newValue != null) { newValue.Parent = obj; ElementsToTombstone.Add(new WeakReference(obj)); CleanupElementsToTombstone(); } if (newValue != null) { obj.Dispatcher.BeginInvoke(() => { try { newValue.CalculateTombstoneId(); } catch { obj.Loaded += (o, a) => newValue.CalculateTombstoneId(); } }); } }
private static void OnTombstonerChanged(FrameworkElement obj, Epitaph oldValue, Epitaph newValue) { if (DesignerProperties.IsInDesignTool) return; if (oldValue != null) oldValue.Parent = null; if (newValue != null) { newValue.Parent = obj; ElementsToTombstone.Add(new WeakReference(obj)); CleanupElementsToTombstone(); } if (newValue != null) obj.Dispatcher.BeginInvoke(() => { try { newValue.CalculateTombstoneId(); } catch { obj.Loaded += (o, a) => newValue.CalculateTombstoneId(); } }); }