AvalonStudio.Controls.ViewModelViewHost.OnDataContextChanged C# (CSharp) Method

OnDataContextChanged() protected method

protected OnDataContextChanged ( ) : void
return void
		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);
            }
        }