I have just been reading WPF Unleashed and it mentioned that the button will look different depending on the XMLNS used.
So I tried the following and it and it bang on right.
In this code the glossy button is loaded.
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<StackPanel Height="40">
<Button Content="Button1"/>
</StackPanel>
</Page>
In this code the non-glossy button is loaded.
<Page xmlns="http://schemas.microsoft.com/netfx/2009/xaml/presentation">
<StackPanel Height="40">
<Button Content="Button1"/>
</StackPanel>
</Page>
I am just trying to figure out what actually is happening? Is it just hardcoded that the PresentationHost.exe loads the 4.0 CLR when it sees the ../netfx/2009/... namespace?
Inside PresentationFramework.dll
there is a mapping using the XmlnsDefinitionAttribute
.
When the compiler hits the namespace, it looks for the specified dlls matching the target XAML namespace:
[System.Windows.Markup.XmlnsDefinitionAttribute("http://schemas.microsoft.com/xps/2005/06", "System.Windows.Media.Animation"),
System.Runtime.CompilerServices.CompilationRelaxationsAttribute(8)
If it hits winfx/2006
it will look for the XAML 2006 corresponding dlls. If it hits netfx/2009
it will look for the XAML 2009 dlls.
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