LocalFontProvider is affected by LocalXamlProvider ?
I have the following directory setup:
If I set my LocalXamlProvider to the directory <root>/Xaml and my LocalFontProvider to directory <root>, everything works fine.
Then I changed the directory of my LocalXamlProvider to <root>, and adjust my code to call LoadXaml with filename prefixed with "Xaml" (e.g. "Xaml/Test.xaml" instead of "Test.xaml"). The Xaml can be loaded correctly, but it fails to load the font.
Is it intended behavior ?
and a xaml file which load a font "Fonts/#Arial Unicode MS", as follows.<root>/Xaml/*.xaml
<root>/Font/*.ttf
Code: Select all
<UserControl x:Class="NoesisTutorial.Tutorial"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:NoesisTutorial"
FontFamily="Fonts/#Arial Unicode MS"
FontSize="20"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="300">
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="NoesisStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<StackPanel>
</StackPanel>
</UserControl>
Then I changed the directory of my LocalXamlProvider to <root>, and adjust my code to call LoadXaml with filename prefixed with "Xaml" (e.g. "Xaml/Test.xaml" instead of "Test.xaml"). The Xaml can be loaded correctly, but it fails to load the font.
Is it intended behavior ?
Re: LocalFontProvider is affected by LocalXamlProvider ?
Yes, because thisThen I changed the directory of my LocalXamlProvider to <root>, and adjust my code to call LoadXaml with filename prefixed with "Xaml" (e.g. "Xaml/Test.xaml" instead of "Test.xaml"). The Xaml can be loaded correctly, but it fails to load the font.
Is it intended behavior ?
Code: Select all
FontFamily="Fonts/#Arial Unicode MS"
You can avoid this behavior by using a non-relative URI:
Code: Select all
FontFamily="/Fonts/#Arial Unicode MS"
Re: LocalFontProvider is affected by LocalXamlProvider ?
Ah, my bad. Didn't realize that the path can be absolute or relative. Thanks.
Re: LocalFontProvider is affected by LocalXamlProvider ?
You welcome. Marking this as solved.
Who is online
Users browsing this forum: No registered users and 3 guests