【发布时间】:2015-05-18 17:39:45
【问题描述】:
我在 Windows 8 上制作了一个 WPF 应用程序(框架 4.5),它使用常用的组合框和其他一些控件。我面临的问题是它在 Windows 7 上崩溃:
A first chance exception of type System.Windows.Markup.XamlParseException occurred in PresentationFramework.dll
Additional information: 'Initialization of 'System.Windows.Controls.ComboBox' threw an exception.'
这是我的组合框 XAML:
<ComboBox Name="bloodGroupList" Grid.Row="7" Grid.Column="1"
SelectedIndex="{Binding Patient.BloodGroup, Converter={StaticResource StrToBlood}, Mode=TwoWay}"
IsEnabled="{Binding IsEditing}"
VerticalAlignment="Center" Margin="5,5.5" VerticalContentAlignment="Center"
BorderThickness="0" Height="22" TabIndex="4" HorizontalContentAlignment="Stretch">
<ComboBoxItem Content="A+" />
<ComboBoxItem Content="A-" />
<ComboBoxItem Content="B+" />
<ComboBoxItem Content="B-" />
<ComboBoxItem Content="O+" />
<ComboBoxItem Content="O-" />
<ComboBoxItem Content="AB+" />
<ComboBoxItem Content="AB-" />
</ComboBox>
我在一些博客上阅读到运行此修复程序NDP45-KB2750147-x64,但它说:
软件更新 KB2750147 安装向导不适用,或被您计算机上的其他情况阻止。详情请点击以下链接。
【问题讨论】:
-
你能展示你用来定义组合框的 XAML 代码吗?
-
你最近清理和重建了吗?您是否在没有调试器的情况下在 Windows 8 机器上尝试过?
-
@O.R.Mapper 代码现已添加
-
@FelixCastor 是的,我已经完成了,而且它在我尝试过的每台 Windows 8 机器上都能正常工作,但在 Windows 7 上崩溃
-
你的转换器是如何定义的?