Hi all,
it is my first post and I'd like to strat it from a small trick for defining value converters in app.xaml file in silverlight project.
Problem:
If you define Converters in app.xaml (see below) then you find that Visual Studio designer fails to render User Controls (Visual Studio designer become blank).
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:myconverters="clr-namespace:MyCustomConverters;assembly=
MyCustomConverters"
x:Class="ConverterInAppXaml.App">
<Application.Resources>
<ResourceDictionary >
<myconverters:MyCustomTextConverter x:Key="myTextConverter"/>
</ResourceDictionary>
</Application.Resources>
</Application>
Upd: not the converter defenition in app.xaml file cause the visual studio designer to go blank but xmlns defenition.
Solution:
To avoid this designer problem move namespace declaration closer to usage:
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="ConverterInAppXaml.App">
<Application.Resources>
<ResourceDictionary xmlns:myconverters="clr-namespace:MyCustomConverters;
assembly=MyCustomConverters">
<myconverters:MyCustomTextConverter x:Key="myTextConverter"/>
</ResourceDictionary>
</Application.Resources>
</Application>
Voila!!! now designer work perfect and able to render our content.