diff --git a/Perspex.Controls/Control.cs b/Perspex.Controls/Control.cs index 790021156a..ab7ccab3e3 100644 --- a/Perspex.Controls/Control.cs +++ b/Perspex.Controls/Control.cs @@ -321,39 +321,6 @@ namespace Perspex.Controls } this.SetValue(ParentProperty, parent); - - if (parent != null) - { - var nameScope = parent.GetSelfAndLogicalAncestors() - .OfType() - .FirstOrDefault(); - - if (nameScope != null) - { - this.RegisterName(nameScope); - - foreach (var descendent in this.GetLogicalDescendents().OfType()) - { - descendent.RegisterName(nameScope); - } - } - } - else if (old != null) - { - var nameScope = old.GetSelfAndLogicalAncestors() - .OfType() - .FirstOrDefault(); - - if (nameScope != null) - { - this.UnregisterName(nameScope); - - foreach (var descendent in this.GetLogicalDescendents().OfType()) - { - descendent.UnregisterName(nameScope); - } - } - } } [Obsolete("Obsolete this: use properties instead")] @@ -443,29 +410,5 @@ namespace Perspex.Controls IStyler styler = Locator.Current.GetService(); styler.ApplyStyles(this); } - - /// - /// Registers the control with the specified name scope. - /// - /// The name scope. - private void RegisterName(INameScope nameScope) - { - if (!string.IsNullOrWhiteSpace(this.Name)) - { - nameScope.RegisterName(this.Name, this); - } - } - - /// - /// Unregisters the control with the specified name scope. - /// - /// The name scope. - private void UnregisterName(INameScope nameScope) - { - if (!string.IsNullOrWhiteSpace(this.Name)) - { - nameScope.UnregisterName(this.Name); - } - } } } diff --git a/Perspex.Controls/INameScope.cs b/Perspex.Controls/INameScope.cs deleted file mode 100644 index a7eeb07781..0000000000 --- a/Perspex.Controls/INameScope.cs +++ /dev/null @@ -1,40 +0,0 @@ -// ----------------------------------------------------------------------- -// -// Copyright 2015 MIT Licence. See licence.md for more information. -// -// ----------------------------------------------------------------------- - -namespace Perspex.Controls -{ - /// - /// Defines the interface for object which define a name scope. - /// - public interface INameScope - { - /// - /// Returns an object tha thas the requested name. - /// - /// The name of the object. - /// The named object or null if the named object was not found. - object FindName(string name); - - /// - /// Registers an object with the specified name in the name scope. - /// - /// The name of the object. - /// The object. - /// - /// An object with the same name has already been registered. - /// - void RegisterName(string name, object o); - - /// - /// Unregisters the specified name in the name scope. - /// - /// The name of the object. - /// - /// The name does not exist in the name scope. - /// - void UnregisterName(string name); - } -} \ No newline at end of file diff --git a/Perspex.Controls/Perspex.Controls.csproj b/Perspex.Controls/Perspex.Controls.csproj index 328b44d18f..8f3d23b5d5 100644 --- a/Perspex.Controls/Perspex.Controls.csproj +++ b/Perspex.Controls/Perspex.Controls.csproj @@ -37,7 +37,6 @@ -