Beispiel #1
0
 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);
            }
        }
Beispiel #3
0
        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);
            }
        }