Greetings, I have a problem changing the focus to some button on xaml. The code I am attemps to do it looks as follows (if some conditions are fulfilled then the focus should be set to the button. The strange is that for test purposes I'm also chaning the background of the button and this property is set each time the conditions are fulfilled. How can I set the default button or set the focus on that button?
<Button.Style>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Path=SomeProperty1.Count, Converter={StaticResource IntegerToBooleanConverter}}" Value="True"/>
<Condition Binding="{Binding Path=SomeProperty2, Converter={StaticResource NullToBoolConverter}}" Value="False"/>
<Condition Binding="{Binding Path=SomeProperty3.Count, Converter={StaticResource IntegerToBooleanConverter}}" Value="True"/>
</MultiDataTrigger.Conditions>
<Setter Property="FocusManager.FocusedElement" Value="{Binding RelativeSource={RelativeSource Self}}"/>
<Setter Property="IsDefault" Value="True"/>
<Setter Property="Background" Value="Green"/>
</MultiDataTrigger>
</Style.Triggers>
additionally i would like to write that SomeProperty1 and SomeProperty2 are set only if I click on the specific button. As I can see these buttons have then the focus.