diff --git a/src/Avalonia.Base/AvaloniaPropertyRegistry.cs b/src/Avalonia.Base/AvaloniaPropertyRegistry.cs
index c0a4ace6ed..e29e7339ae 100644
--- a/src/Avalonia.Base/AvaloniaPropertyRegistry.cs
+++ b/src/Avalonia.Base/AvaloniaPropertyRegistry.cs
@@ -106,7 +106,7 @@ namespace Avalonia
}
///
- /// Finds a registered non-attached property on a type by name.
+ /// Finds a registered property on a type by name.
///
/// The type.
/// The property name.
@@ -130,7 +130,7 @@ namespace Avalonia
}
///
- /// Finds a registered non-attached property on a type by name.
+ /// Finds a registered property on an object by name.
///
/// The object.
/// The property name.
@@ -148,52 +148,6 @@ namespace Avalonia
return FindRegistered(o.GetType(), name);
}
- ///
- /// Finds a registered attached property on a type by name.
- ///
- /// The type.
- /// The owner type.
- /// The property name.
- ///
- /// The registered property or null if no matching property found.
- ///
- ///
- /// The property name contains a '.'.
- ///
- public AvaloniaProperty FindRegisteredAttached(Type type, Type ownerType, string name)
- {
- Contract.Requires(type != null);
- Contract.Requires(ownerType != null);
- Contract.Requires(name != null);
-
- if (name.Contains('.'))
- {
- throw new InvalidOperationException("Attached properties not supported.");
- }
-
- return GetRegisteredAttached(type).FirstOrDefault(x => x.Name == name);
- }
-
- ///
- /// Finds a registered non-attached property on a type by name.
- ///
- /// The object.
- /// The owner type.
- /// The property name.
- ///
- /// The registered property or null if no matching property found.
- ///
- ///
- /// The property name contains a '.'.
- ///
- public AvaloniaProperty FindRegisteredAttached(AvaloniaObject o, Type ownerType, string name)
- {
- Contract.Requires(o != null);
- Contract.Requires(name != null);
-
- return FindRegisteredAttached(o.GetType(), ownerType, name);
- }
-
///
/// Checks whether a is registered on a type.
///
@@ -287,4 +241,4 @@ namespace Avalonia
_attachedCache.Clear();
}
}
-}
\ No newline at end of file
+}
diff --git a/src/Markup/Avalonia.Markup.Xaml/Converters/AvaloniaPropertyTypeConverter.cs b/src/Markup/Avalonia.Markup.Xaml/Converters/AvaloniaPropertyTypeConverter.cs
index 6cdf0452d0..2470778685 100644
--- a/src/Markup/Avalonia.Markup.Xaml/Converters/AvaloniaPropertyTypeConverter.cs
+++ b/src/Markup/Avalonia.Markup.Xaml/Converters/AvaloniaPropertyTypeConverter.cs
@@ -4,6 +4,7 @@
using System;
using System.ComponentModel;
using System.Globalization;
+using Avalonia.Controls;
using Avalonia.Markup.Parsers;
using Avalonia.Markup.Xaml.Parsers;
using Avalonia.Markup.Xaml.Templates;
@@ -21,26 +22,27 @@ namespace Avalonia.Markup.Xaml.Converters
public override object ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)
{
+ var registry = AvaloniaPropertyRegistry.Instance;
var parser = new PropertyParser();
var reader = new Reader((string)value);
var (ns, owner, propertyName) = parser.Parse(reader);
- var ownerType = TryResolveOwnerByName(context, ns, owner) ??
- context.GetFirstAmbientValue()?.TargetType ??
- context.GetFirstAmbientValue
+
+
+";
+ var loader = new AvaloniaXamlLoader();
+ var ex = Assert.Throws(() => loader.Load(xaml));
+
+ Assert.Equal(
+ "Property 'Button.IsDefault' is not registered on 'Avalonia.Controls.TextBlock'.",
+ ex.InnerException.Message);
+ }
+ }
}
}