Я хочу изменить стиль "Template10.Validation", когда возникает ошибка проверки. Вот мой целевой стиль.
а я пробовал.. но там странные ошибки...
<validate:ControlWrapper Property="{Binding SettingEmailModel}" PropertyName="EmailReceivers">
<validate:ControlWrapper.Template>
<ControlTemplate TargetType="validate:ControlWrapper">
<StackPanel DataContext="{TemplateBinding Property}">
<TextBlock Text="IsValid" />
<TextBlock Text="{Binding IsValid}" />
<TextBlock Text="Errors" />
<TextBlock Text="{Binding Errors.Count}" />
<ContentPresenter Content="{TemplateBinding Content}" />
<TextBlock x:Name="ValidationNotifyTextBlock" Text="{Binding Errors[0]}">
<Interactivity:Interaction.Behaviors>
<Core:DataTriggerBehavior Binding="{Binding IsValid}" Value="True">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ValidationNotifyTextBlock}"
PropertyName="Foreground" Value="Red"/>
</Core:DataTriggerBehavior>
<Core:DataTriggerBehavior Binding="{Binding IsValid}" Value="False">
<Core:ChangePropertyAction TargetObject="{Binding ElementName=ValidationNotifyTextBlock}"
PropertyName="Foreground" Value="Black"/>
</Core:DataTriggerBehavior>
</Interactivity:Interaction.Behaviors>
</TextBlock>
</StackPanel>
</ControlTemplate>
</validate:ControlWrapper.Template>
<Grid>
<TextBox Text="{Binding SettingEmailModel.EmailReceivers, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
MinHeight="400" Style="{StaticResource SettingStyle_MultilineTextBox}"/>
</Grid>
</validate:ControlWrapper>
Вот сообщение об ошибке "Свойство коллекции __implicit_propery равно null"
1) Я пробовал версии 1.1 и 2.0 "Microsoft.Xaml. .Behaviors.Uwp.Управляемый"
Я не знаю, почему произошла ошибка. Пожалуйста, посоветуйте мне или, можете ли вы создать стиль для моего дизайна?