protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
{
base.OnPropertyChanged(e);
// See OnVisualParentChanged method for the elaborate explanation.
// In a gist this is a hack to capture a reference to the
// PrivateSharedSizeScopeProperty.
if (_privateSharedSizeScopeProperty == null &&
e.Property.OwnerType == typeof(DefinitionBase) &&
e.Property.Name == "PrivateSharedSizeScope")
{
_privateSharedSizeScopeProperty = e.Property;
}
}