Laden...

Silverlight/WP8: DataStateBehavior parsing exception in xaml

Erstellt von KainPlan vor 10 Jahren Letzter Beitrag vor 10 Jahren 943 Views
K
KainPlan Themenstarter:in
133 Beiträge seit 2009
vor 10 Jahren
Silverlight/WP8: DataStateBehavior parsing exception in xaml

Hi,

ich reiß mir gerade die Haare aus, ich weiß genau das ich so einen Fehler schonmal beim Pivot hatte aber ich weiß nicht mehr was ich damals gemacht hatte. Jedenfalls will ich einen DataStateBehavior zu meinem UserControl hinzufügen, allerdings bekomm ich während der** !ausführung!** eine parsing exception (System.Windows.Markup.XamlParseException) dessen position immer auf das letzte "=" des DataStateBehavior zeigt. Auch im XAML Editor wird ein Fehler angezeigt allerdings bei einer Border und das Passt irgendwie alles nicht. Ich hab gerade ein Brett vorm Kopf 😦.

Edit: Ich hab Übersichtshalber mal den VisualStateManager-Block entfernt.


<UserControl x:Class="TLApp.UserControls.Articles.ArticleTemplate"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:ic="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    xmlns:local="clr-namespace:TLApp" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="480" d:DesignWidth="480">
    
    <Grid Tap="ArtcileTapped">
        <local:ArticleTemplateSelector Content="{Binding}">
            <local:ArticleTemplateSelector.Article>
                <DataTemplate>
                    <Grid Margin="0" Width="480" Height="180" Background="White">
                        <i:Interaction.Behaviors>
                            <ic:DataStateBehavior Binding="{Binding Selected}" Value="True" FalseState="Normal" TrueState="Selected"  />
                        </i:Interaction.Behaviors>                        
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="128" />
                            <ColumnDefinition Width="1*" />
                        </Grid.ColumnDefinitions>
                        <Image HorizontalAlignment="Center" Grid.Column="0" Source="{Binding Article, Converter={StaticResource ArticleImageConverter}, Mode=OneWay}" />
                        <Grid Grid.Column="1" Margin="10">
                            <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Text="{Binding Article.ArticleName}" FontSize="23" FontWeight="Bold" Foreground="#FF0C0C0C" TextWrapping="Wrap" />
                            <TextBlock HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Row="2" Foreground="#FF0C0C0C">
                                <Run Text="{Binding Article.PriceBrutto, StringFormat=\{0:0.00\}}" />
                                <Run Text="{Binding Localizedresources.STR_Currency, Source={StaticResource LocStrings}}" />
                            </TextBlock>
                        </Grid>
                        <Border VerticalAlignment="Bottom" Height="2" Width="480" Background="{StaticResource list_separator}" />
                    </Grid>
                </DataTemplate>
            </local:ArticleTemplateSelector.Article>

Hat denn echt niemand eine Idee? Ich versteh das echt nicht wenn ich ein neues Projekt anlege mit genau diesem UserControl funktioniert es ohne Probleme..