Skip to content

Commit d66b9b8

Browse files
authored
Fix for GetXmlNamespaceMaps and SetXmlNamespaceMaps exception (#8510)
* Addressed invalid cast Exception * Changed datatype for SetXmlNamespaceMaps * Fix for API Compat error
1 parent 9a0cd95 commit d66b9b8

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

src/Microsoft.DotNet.Wpf/ApiCompat/Baselines/PresentationFramework-ref-Net48.baseline.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,6 @@ TypesMustExist : Type 'System.Windows.Interop.DocObjHost' does not exist in the
3333
CannotRemoveAttribute : Attribute 'System.ComponentModel.TypeConverterAttribute' exists on 'System.Windows.Markup.StaticExtension' in the contract but not the implementation.
3434
CannotRemoveAttribute : Attribute 'System.ComponentModel.TypeConverterAttribute' exists on 'System.Windows.Markup.TypeExtension' in the contract but not the implementation.
3535
CannotRemoveBaseTypeOrInterface : Type 'System.Windows.Markup.XamlParseException' does not implement interface 'System.Runtime.InteropServices._Exception' in the implementation but it does in the contract.
36-
Total Issues: 34
36+
MembersMustExist : Member 'public System.String System.Windows.Markup.XmlAttributeProperties.GetXmlNamespaceMaps(System.Windows.DependencyObject)' does not exist in the implementation but it does exist in the contract.
37+
MembersMustExist : Member 'public void System.Windows.Markup.XmlAttributeProperties.SetXmlNamespaceMaps(System.Windows.DependencyObject, System.String)' does not exist in the implementation but it does exist in the contract.
38+
Total Issues: 36

src/Microsoft.DotNet.Wpf/cycle-breakers/PresentationFramework/PresentationFramework.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11485,7 +11485,7 @@ internal XmlAttributeProperties() { }
1148511485
public static readonly System.Windows.DependencyProperty XmlSpaceProperty;
1148611486
[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
1148711487
[System.Windows.AttachedPropertyBrowsableForTypeAttribute(typeof(System.Windows.DependencyObject))]
11488-
public static string GetXmlNamespaceMaps(System.Windows.DependencyObject dependencyObject) { throw null; }
11488+
public static System.Collections.Hashtable GetXmlNamespaceMaps(System.Windows.DependencyObject dependencyObject) { throw null; }
1148911489
[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
1149011490
[System.Windows.AttachedPropertyBrowsableForTypeAttribute(typeof(System.Windows.DependencyObject))]
1149111491
[System.Windows.Markup.DesignerSerializationOptionsAttribute(System.Windows.Markup.DesignerSerializationOptions.SerializeAsAttribute)]
@@ -11496,7 +11496,7 @@ internal XmlAttributeProperties() { }
1149611496
[System.Windows.AttachedPropertyBrowsableForTypeAttribute(typeof(System.Windows.DependencyObject))]
1149711497
[System.Windows.Markup.DesignerSerializationOptionsAttribute(System.Windows.Markup.DesignerSerializationOptions.SerializeAsAttribute)]
1149811498
public static string GetXmlSpace(System.Windows.DependencyObject dependencyObject) { throw null; }
11499-
public static void SetXmlNamespaceMaps(System.Windows.DependencyObject dependencyObject, string value) { }
11499+
public static void SetXmlNamespaceMaps(System.Windows.DependencyObject dependencyObject, System.Collections.Hashtable value) { }
1150011500
public static void SetXmlnsDefinition(System.Windows.DependencyObject dependencyObject, string value) { }
1150111501
public static void SetXmlnsDictionary(System.Windows.DependencyObject dependencyObject, System.Windows.Markup.XmlnsDictionary value) { }
1150211502
public static void SetXmlSpace(System.Windows.DependencyObject dependencyObject, string value) { }

src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Markup/XmlAttributeProperties.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -296,14 +296,14 @@ public static void SetXmlnsDefinition(DependencyObject dependencyObject, string
296296
/// </remarks>
297297
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
298298
[AttachedPropertyBrowsableForType(typeof(DependencyObject))]
299-
public static string GetXmlNamespaceMaps(DependencyObject dependencyObject)
299+
public static Hashtable GetXmlNamespaceMaps(DependencyObject dependencyObject)
300300
{
301301
if (dependencyObject == null)
302302
{
303303
throw new ArgumentNullException( "dependencyObject" );
304304
}
305305

306-
return (string)dependencyObject.GetValue(XmlNamespaceMapsProperty);
306+
return (Hashtable)dependencyObject.GetValue(XmlNamespaceMapsProperty);
307307
}
308308

309309
/// <summary>
@@ -312,7 +312,7 @@ public static string GetXmlNamespaceMaps(DependencyObject dependencyObject)
312312
/// <remarks>
313313
/// XmlNamespaceMaps map xml namespace uri to Assembly/CLR namespaces
314314
/// </remarks>
315-
public static void SetXmlNamespaceMaps(DependencyObject dependencyObject, string value)
315+
public static void SetXmlNamespaceMaps(DependencyObject dependencyObject, Hashtable value)
316316
{
317317
if (dependencyObject == null)
318318
{

src/Microsoft.DotNet.Wpf/src/PresentationFramework/ref/PresentationFramework.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11505,7 +11505,7 @@ internal XmlAttributeProperties() { }
1150511505
public static readonly System.Windows.DependencyProperty XmlSpaceProperty;
1150611506
[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
1150711507
[System.Windows.AttachedPropertyBrowsableForTypeAttribute(typeof(System.Windows.DependencyObject))]
11508-
public static string GetXmlNamespaceMaps(System.Windows.DependencyObject dependencyObject) { throw null; }
11508+
public static System.Collections.Hashtable GetXmlNamespaceMaps(System.Windows.DependencyObject dependencyObject) { throw null; }
1150911509
[System.ComponentModel.DesignerSerializationVisibilityAttribute(System.ComponentModel.DesignerSerializationVisibility.Hidden)]
1151011510
[System.Windows.AttachedPropertyBrowsableForTypeAttribute(typeof(System.Windows.DependencyObject))]
1151111511
[System.Windows.Markup.DesignerSerializationOptionsAttribute(System.Windows.Markup.DesignerSerializationOptions.SerializeAsAttribute)]
@@ -11516,7 +11516,7 @@ internal XmlAttributeProperties() { }
1151611516
[System.Windows.AttachedPropertyBrowsableForTypeAttribute(typeof(System.Windows.DependencyObject))]
1151711517
[System.Windows.Markup.DesignerSerializationOptionsAttribute(System.Windows.Markup.DesignerSerializationOptions.SerializeAsAttribute)]
1151811518
public static string GetXmlSpace(System.Windows.DependencyObject dependencyObject) { throw null; }
11519-
public static void SetXmlNamespaceMaps(System.Windows.DependencyObject dependencyObject, string value) { }
11519+
public static void SetXmlNamespaceMaps(System.Windows.DependencyObject dependencyObject, System.Collections.Hashtable value) { }
1152011520
public static void SetXmlnsDefinition(System.Windows.DependencyObject dependencyObject, string value) { }
1152111521
public static void SetXmlnsDictionary(System.Windows.DependencyObject dependencyObject, System.Windows.Markup.XmlnsDictionary value) { }
1152211522
public static void SetXmlSpace(System.Windows.DependencyObject dependencyObject, string value) { }

0 commit comments

Comments
 (0)