Reputation: 90583
I use a TabControl
Each tab has its default button.
The first default button is working.
The second default button is a normal button.
How to fix that?
Upvotes: 1
Views: 1198
Reputation: 39650
You could bind each Button's IsDefault
property to its corresponding TabItem's IsSelected
Property. Each time the selected tab item changes, another button would become the default, then.
Something like that:
<TabControl>
<TabItem x:Name="tab1" ... />
<!-- ... other tabs ... -->
</TabControl>
<Button x:Name="button1" IsDefault="{Binding IsSelected, ElementName=tab1}"/>
<!-- ... other buttons ... -->
Upvotes: 11