protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) { base.OnPropertyChanged(e); if (ContentProperty.Equals(e.Property)) { if (!absoluteLayout.Equals(e.NewValue) && e.NewValue is UIElement) { Content = null; contentView.Children.Clear(); contentView.Children.Add(e.NewValue as UIElement); Content = absoluteLayout; } } }