我的WPF应用程序中有一个组合框:
<ComboBox ItemsSource="{Binding CompetitorBrands}" DisplayMemberPath="Value"
SelectedValuePath="Key" SelectedValue="{Binding Path=CompMfgBrandID, Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}" Text="{Binding CompMFGText}"/>
Run Code Online (Sandbox Code Playgroud)
绑定到的集合 KeyValuePair<string, string>
这是我的ViewModel中的CompMfgBrandID属性:
public string CompMfgBrandID
{
get { return _compMFG; }
set
{
if (StockToExchange != null && StockToExchange.Where(x => !string.IsNullOrEmpty(x.EnteredPartNumber)).Count() > 0)
{
var dr = MessageBox.Show("Changing the competitor manufacturer will remove all entered parts from the transaction. Proceed?",
"Transaction Type", MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
if (dr != DialogResult.Yes)
return;
}
_compMFG = value;
StockToExchange.Clear();
...a bunch of other functions that don't get called when you click …Run Code Online (Sandbox Code Playgroud) 我刚刚添加了System.Windows.Interactivity程序集.XamlParse在运行时抛出异常:
无法加载文件或程序集'System.Windows.Interactivity,PublicKeyToken = 31bf3856ad364e35'或其依赖项之一.该系统找不到指定的文件.
谷歌搜索只找到与棱镜相关的结果 - 我不使用.
知道为什么会这样吗?