There are two Xaml Readers. One of them is included in System.Xaml
the other one is included in System.Windows.Markup
.
What is the difference between them?
Taken from MSDN:
WPF types and the WPF technology in general support concepts that rely on access to WPF internals. For instance, how WPF implements dependency properties relies on internal techniques for efficient type-member lookup. Access to these internals is enabled by the XAML reading and writing APIs provided in
XamlWriter
andXamlReader
from theSystem.Windows.Markup
namespace and PresentationFramework assembly. However, the lower-level XAML readers and XAML writers from theSystem.Xaml
assembly (classes based onSystem.Xaml.XamlReader
,System.Xaml.XamlWriter
) do not have access to the WPF internals. There is no dependency fromSystem.Xaml
to any WPF-specific assembly. Without access to the WPF internals,System.Xaml
readers and writers cannot correctly load or save all WPF types, or types based on WPF types. In particular, theSystem.Xaml
readers and writers do not understand concepts such as the WPF dependency property backing property store, or all the specifics of how WPF uses styles, resource dictionaries and templates. Therefore you have a choice to make:
- If you are loading WPF types, and/or you are using XAML in BAML form in any way, use the PresentationFramework XAML readers and XAML writers.
- If you are not relying on any WPF types or the BAML form of XAML, and are not using another specific technology's XAML reader or XAML writer implementation for reasons that are specific to that framework, use the
System.Xaml
XAML readers and XAML writers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With