在WPf,C#中工作并使用MVVM-C我在VS的立即窗口中出现以下错误.
我正在谈论的窗口充满了一些文本框和数据网格,用户可以在其中添加新行.填写文本框时,不会显示任何问题.由于这个问题,我无法保存更改.实际上,"保存"按钮不起作用.
但是,只要我点击空数据网格以便能够添加一些数据,我就会在即时窗口中收到以下错误:
System.Windows.Data Error: 23 : Cannot convert '{NewItemPlaceholder}' from type 'NamedObject' to type 'LIMS.ViewModels.ComponentViewModel' for 'en-US' culture with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException: TypeConverter kan niet van MS.Internal.NamedObject worden geconverteerd.
- bij System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
- bij System.ComponentModel.TypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
- bij MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)'
System.Windows.Data Error: 7 : ConvertBack cannot convert value '{NewItemPlaceholder}' (type 'NamedObject'). BindingExpression:Path=SelectedTestConfiguration.SelectedComponent; DataItem='TestConfigurationsPageViewModel' (HashCode=64210551); target element is 'DataGrid' (Name=''); target …Run Code Online (Sandbox Code Playgroud)