Enable a TabItem via Binding

前端 未结 1 2112
滥情空心
滥情空心 2021-02-14 13:55

I want to use MVVM in an application where the different pages are TabItems.

For this I use an observable collection of my view models (Items) and bind it to the tabcont

相关标签:
1条回答
  • 2021-02-14 14:16

    Maybe you could try something like this -

    <TabControl>
        <TabControl.ItemContainerStyle>
            <Style TargetType="{x:Type TabItem}">
                 <Setter Property="IsEnabled" Value="{Binding IsEnabled}"/>        
            </Style>
        </TabControl.ItemContainerStyle>
    </TabControl>
    
    0 讨论(0)
提交回复
热议问题