PropertyChanged要为索引器和特定索引值引发事件,请执行以下操作:
OnPropertyChanged(string.Format(CultureInfo.CurrentCulture, "Item[{0}]", indexValue));
但是如果索引器接受多个索引值呢?而不是Item[{0}],格式字符串应该是什么样的?是Item[{0},{1},{3}]还是也许Item[{0}][{1}][{3}]?
PropertyChanged要为索引器和特定索引值引发事件,请执行以下操作:
OnPropertyChanged(string.Format(CultureInfo.CurrentCulture, "Item[{0}]", indexValue));
但是如果索引器接受多个索引值呢?而不是Item[{0}],格式字符串应该是什么样的?是Item[{0},{1},{3}]还是也许Item[{0}][{1}][{3}]?
我有类似的东西,我将多个值传递给一个订阅的函数,OnPropertyChanged并只使用一些字符来解析项目。
如果我理解正确,您只是想使这些值正确吗?
你可以这样做:
OnPropertyChanged(string.Format(CultureInfo.CurrentCulture, "Item[{0}];Item[{1}];Item[{2}]", indexValue, indexValue1, indexValue2));
然后只需解析;使用:
string[] stringArray = yourString.Split(';')
希望有帮助