我尝试使用通用类型的CATEL属性。 我在Model属性中有XmlException。
[Serializable]
public class TDS : SavableModelBase<TDS>
{
public TestType<bool> Tds
{
get { return GetValue<TestType<bool>>(TdsProperty); }
set { SetValue(TdsProperty, value); }
}
public static readonly PropertyData TdsProperty = RegisterProperty("Tds", typeof(TestType<bool>));
public TDS(TestType<bool> tds)
{
Tds = tds;
}
}
当我使用catel prop 时,ViewModel
public class MainWindowViewModel : ViewModelBase
{
[Model]
public TDS Xxx //when assigning XMLException The '`' character, hexadecimal value 0x60, cannot be included in a name.
{
get { return GetValue<TDS>(XxxProperty); }
set { SetValue(XxxProperty, value); }
}
public static readonly PropertyData XxxProperty = RegisterProperty("Xxx", typeof(TDS));
}
主结构中的class modelBase,其中catel prop
[Serializable]
public class TestType<T> : ModelBase
{
public TestType(ushort val)
{
Val = val;
}
public ushort Val
{
get { return GetValue<ushort>(ValProperty); }
set { SetValue(ValProperty, value); }
}
public static readonly PropertyData ValProperty = RegisterProperty("Val", typeof(ushort));
}
我认为这个问题,在通用的catel prop
中帮助我!!!