I set the Text property of the Text box control and also add Interaction.Trigger to it. An exception is thrown. When I try to XamlReader.Parse() this XAML using XamlReader.Parse() :
Xaml, which I have:
<Grid xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Name="TopPanel" > <Grid.ColumnDefinitions> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition /> <RowDefinition /> </Grid.RowDefinitions> <TextBox Name="TextBox_8241" FocusManager.IsFocusScope="True" Grid.Column="1" Grid.Row="1" xml:space="preserve" Text="{Binding ppp, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"> <i:Interaction.Triggers> <i:EventTrigger EventName="MouseEnter"> <cmd:EventToCommand PassEventArgsToCommand="True" Command="{Binding TextBox_8241_MouseEnterCommand}" /> </i:EventTrigger> </i:Interaction.Triggers> </TextBox> </Grid>
Exception message: {The "Text" property is already set to "TextBox". Line number '1' and line position 'X'. "}
the position of the line points to the closing tag TextBox </TextBox>
If I do not install Interaction.Triggers, it parses OK, but at least one set of Interaction.Triggers, it throws an exception ...
Can someone give me some light on this please?
source share