MaterialDesignInXAML / MaterialDesignInXAML/MaterialDesignInXamlToolkit
MaterialDesignFilledTabControl Binding Issues
还没有人认领这个 Issue。
- 主要语言
- C#
- 星标
- 16.3k
- 派生
- 3.5k
- 平均合并
- 1 天 22 小时
- 30 天内合并 PR
- 8
描述
I have been trying to use the TabControl style MaterialDesignFilledTabControl. When I try to use it, it results in binding issues. When I change that style to MaterialDesignNavigationRailTabControl all the binding errors go away. I am not sure exactly what is causing the issue. When I run the UI and I try to use the combo boxes within the MaterialDesignFilledTabControl tab it breaks the UI. The combo box works fine with the MaterialDesignNavigationRailTabControl.
<TabControl ItemsSource="{Binding Tabs}"
TabStripPlacement="Left"
Style="{StaticResource MaterialDesignFilledTabControl}"
materialDesign:ColorZoneAssist.Mode="Standard" Loaded="TabControl_OnLoaded">
<TabControl.ItemTemplate>
<DataTemplate DataType="uiHelpers:TabViewModel">
<Viewbox
Height="Auto">
<TextBlock Text="{Binding TabName}"/>
</Viewbox>
</DataTemplate>
</TabControl.ItemTemplate>
<TabControl.ContentTemplate>
<DataTemplate DataType="uiHelpers:TabViewModel">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Stretch" Height="Auto">
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto" Margin="10 0 10 0" VerticalAlignment="Stretch" Height="Auto">
<DataGrid ItemsSource="{Binding ProjectViewModel.ParameterList}" AutoGenerateColumns="False" Background="{DynamicResource MaterialDesignBackground}">
<DataGrid.Resources>
<DataTemplate x:Key="TextBox" DataType="core:ParamViewModel">
<TextBox Text="{Binding SelectedValue, Mode=TwoWay}"/>
</DataTemplate>
<DataTemplate x:Key="ComboBox" DataType="core:ParamViewModel">
<ComboBox
ItemsSource="{Binding Options}"
SelectedItem="{Binding SelectedValue, Mode=TwoWay}"
Style="{StaticResource MaterialDesignOutlinedComboBox}"/>
</DataTemplate>
<local:DynamicDataTemplateSelector x:Key="DynamicDataTemplateSelector"/>
</DataGrid.Resources>
<DataGrid.Columns>
<DataGridTextColumn Header="User Parameters" Binding="{Binding UserParameterName}" IsReadOnly="True"/>
<DataGridTemplateColumn Header="Current Value" CellTemplateSelector="{StaticResource DynamicDataTemplateSelector}"/>
</DataGrid.Columns>
</DataGrid>
</ScrollViewer>
</StackPanel>
</DataTemplate>
</TabControl.ContentTemplate>
</TabControl>
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用提供的 XAML 重现绑定错误,先使用 MaterialDesignFilledTabControl,然后使用 MaterialDesignNavigationRailTabControl 进行比较。检查选项卡控件样式以及 ComboBox/DataGrid 绑定,并在 filled 样式不再破坏 UI 或产生所报告的绑定错误时,将此问题视为已完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- csharp
- 领域
- desktop
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 需要澄清
- 新手友好度
- 25/100