Silverlight 4: "Invalid XAML" using converter in DataTemplate

maybe you could help me understand why I get an unhandled "Invalid XAML" exception in the designer of Visual Studio 2010 when I try to do the following on Page.

I have Converterwith a name DateTimeConverterthat converts a date to a German date string. The converter is operating normally. I included the namespace and added the page resources:

<navigation:Page.Resources>
    <myClasses:DateTimeConverter x:Key="dateTime" />
</navigation:Page.Resources>

Now I have a list box that I want to bind to a list of objects. I am doing the binding in code, but I would like to define a data pattern. Thus, I added the following to my layout:

<ListBox x:Name="lbConversation" BorderBrush="#00000000">
    <ListBox.ItemTemplate>
        <DataTemplate>
            <Border BorderThickness="0" Padding="4">
                <StackPanel Orientation="Vertical">
                    <TextBlock Text="{Binding Message, Mode=OneWay}" />
                    <TextBlock Text="{Binding TimeStamp, Mode=OneWay, Converter={StaticResource dateTime}}" />
                </StackPanel>
            </Border>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

, . , " XAML". Converter=..., .

? ?


: WPF!

+5
4

, , , ?

, , ... , , , ? CultureInfo , ; , , , ...

+1

Xaml, , , Xaml. Xaml InvariantCulture, , , visual studio Xaml, . , , .

, UserControl InitializeComponent: -

 this.Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name);

, .

+1

" XAML", . , .

.

0

All Articles