Skip to content

Commit 853953c

Browse files
Added support for Microsoft.UI.Xaml dependency property (#563)
* Added Microsoft Xaml Dependency Property support * Trigger CI * Update AttachedEntitiesHelper.cs Co-authored-by: anmeng10101 <33647870+anmeng10101@users.noreply.github.com>
1 parent 3f9c168 commit 853953c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

mdoc/Consts.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ public static class Consts
2222
public const string JavascriptLowCase = "javascript";
2323

2424
public const string DependencyPropertyFullName = "System.Windows.DependencyProperty";
25-
public const string DependencyPropertyFullNameXaml = "Windows.UI.Xaml.DependencyProperty";
25+
public const string DependencyPropertyFullNameWindowsXaml = "Windows.UI.Xaml.DependencyProperty";
26+
public const string DependencyPropertyFullNameMicrosoftXaml = "Microsoft.UI.Xaml.DependencyProperty";
2627

2728
public const string DependencyObjectFullName = "System.Windows.DependencyObject";
2829
public const string DependencyObjectFullNameXaml = "Windows.UI.Xaml.DependencyObject";

mdoc/Mono.Documentation/Util/AttachedEntitiesHelper.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ private static IEnumerable<AttachedPropertyReference> GetAttachedProperties(Type
116116
}
117117

118118
foreach (var property in type.Properties.Where(t => t.PropertyType.FullName == Consts.DependencyPropertyFullName
119-
|| t.PropertyType.FullName == Consts.DependencyPropertyFullNameXaml))
119+
|| t.PropertyType.FullName == Consts.DependencyPropertyFullNameWindowsXaml
120+
|| t.PropertyType.FullName == Consts.DependencyPropertyFullNameMicrosoftXaml))
120121
{
121122
if (IsAttachedProperty(property, methods))
122123
yield return new AttachedPropertyReference(property);
@@ -138,7 +139,8 @@ private static bool IsAttachedProperty(FieldDefinition field, Dictionary<string,
138139

139140
return !hasExistingProperty.IsTrue () && !hasExistingField.IsTrue () &&
140141
// Class X has a static field of type DependencyProperty [Name]Property
141-
(field.FieldType.FullName == Consts.DependencyPropertyFullName || field.FieldType.FullName == Consts.DependencyPropertyFullNameXaml)
142+
(field.FieldType.FullName == Consts.DependencyPropertyFullName || field.FieldType.FullName == Consts.DependencyPropertyFullNameWindowsXaml
143+
|| field.FieldType.FullName == Consts.DependencyPropertyFullNameMicrosoftXaml)
142144
&& field.IsPublic
143145
&& field.IsStatic
144146
&& field.IsInitOnly
@@ -163,7 +165,8 @@ private static bool IsAttachedProperty(PropertyDefinition property, Dictionary<s
163165

164166
return !hasExistingProperty.IsTrue() && !hasExistingField.IsTrue() &&
165167
// Class X has a static field of type DependencyProperty [Name]Property
166-
(property.PropertyType.Name == Consts.DependencyPropertyFullName || property.PropertyType.FullName == Consts.DependencyPropertyFullNameXaml)
168+
(property.PropertyType.FullName == Consts.DependencyPropertyFullName || property.PropertyType.FullName == Consts.DependencyPropertyFullNameWindowsXaml
169+
|| property.PropertyType.FullName == Consts.DependencyPropertyFullNameMicrosoftXaml)
167170

168171

169172
// Class X also has static methods with the following names: Get[Name] and Set[Name]

0 commit comments

Comments
 (0)