TabControl MVVM 的问题

问题描述

我的应用程序中有一个 TabControl 定义:

<TabControl Grid.Row="1" Grid.Column="0" Grid.RowSpan="4" Grid.ColumnSpan="4"
                    ItemsSource="{Binding TabItemSource}"
                    SelectedItem="{Binding SelectedTabItem}">

            <TabControl.ItemTemplate>
                <DataTemplate>
                    <HeaderedContentControl Header="{Binding Name}" 
                                            Height="50" Width="120" FontSize="20"/>
                </DataTemplate>
            </TabControl.ItemTemplate>

            <TabControl.ContentTemplate>
                <DataTemplate>
                    <ContentControl Content="{Binding Selectedviewmodel}"/>
                </DataTemplate>
            </TabControl.ContentTemplate>
            
 </TabControl>

当我单击一个选项卡时,我的视图会隐藏我的 tabControl 的所有选项卡。

你知道这可能是什么错误吗?

一些奇怪行为的屏幕:

感谢您的帮助

---- 编辑---- ContentControl 绑定属性未绑定到 good 属性上。 已修复。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)