SetFocusAction TargetName only works when inside the target
Posted: 12 Apr 2021, 18:11
Hello,
I noticed that:
Only works when is part of triggers for SomeButton, and not a panel, or another element.
I feel like I'm just doing something wrong ..
This works fine:
This does not work:
What am I doing wrong?
I noticed that:
Code: Select all
<i:EventTrigger EventName="IsVisibleChanged">
<noesis:SetFocusAction TargetName="SomeButton" />
</i:EventTrigger>I feel like I'm just doing something wrong ..
This works fine:
Code: Select all
<StackPanel>
<Button x:Name="SomeButton" Style="{StaticResource SomeButtonStyle}" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="IsVisibleChanged">
<noesis:SetFocusAction TargetName="SomeButton" /> <!-- TargetName optional here -->
</i:EventTrigger>
</i:Interaction.Triggers>
</Button>
</StackPanel>
Code: Select all
<StackPanel
<i:Interaction.Triggers>
<i:EventTrigger EventName="IsVisibleChanged">
<noesis:SetFocusAction TargetName="SomeButton" />
</i:EventTrigger>
</i:Interaction.Triggers>
>
<Button x:Name="SomeButton" Style="{StaticResource SomeButtonStyle}" >
</Button>
</StackPanel>