protected override void OnDataContextChanged() { if (DataContext != null) { Content = ViewLocator.Build(DataContext); } }
protected override void OnDataContextChanged() { if (Content as ILogical != null) { LogicalChildren.Remove(Content as ILogical); } if (DataContext != null) { Content = ViewLocator.Build(DataContext); } if (Content as ILogical != null) { LogicalChildren.Add(Content as ILogical); } }
protected override void OnDataContextEndUpdate() { base.OnDataContextEndUpdate(); if (Content as ILogical != null) { LogicalChildren.Remove(Content as ILogical); } if (DataContext != null) { Content = ViewLocator.Build(DataContext); } if (Content as ILogical != null) { LogicalChildren.Add(Content as ILogical); } }