本文整理汇总了C#中PerspexProperty.AddOwner方法的典型用法代码示例。如果您正苦于以下问题:C# PerspexProperty.AddOwner方法的具体用法?C# PerspexProperty.AddOwner怎么用?C# PerspexProperty.AddOwner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PerspexProperty
的用法示例。
在下文中一共展示了PerspexProperty.AddOwner方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddOwner_On_Direct_Property_Without_Getter_Or_Setter_Should_Throw
public void AddOwner_On_Direct_Property_Without_Getter_Or_Setter_Should_Throw()
{
var p1 = new PerspexProperty<string>("e1", typeof(Class1), o => null, (o, v) => { });
Assert.Throws<InvalidOperationException>(() => p1.AddOwner<Class3>());
}
示例2: AddOwnered_Direct_Properties_Should_Share_Observables
public void AddOwnered_Direct_Properties_Should_Share_Observables()
{
var p1 = new PerspexProperty<string>("d1", typeof(Class1), o => null, (o, v) => { });
var p2 = p1.AddOwner<Class3>(o => null, (o, v) => { });
Assert.Same(p1.Changed, p2.Changed);
Assert.Same(p1.Initialized, p2.Initialized);
}
示例3: AddOwner_With_Getter_And_Setter_On_Standard_Property_Should_Throw
public void AddOwner_With_Getter_And_Setter_On_Standard_Property_Should_Throw()
{
var p1 = new PerspexProperty<string>("p1", typeof(Class1));
Assert.Throws<InvalidOperationException>(() => p1.AddOwner<Class3>(o => null, (o, v) => { }));
}
示例4: AddOwnered_Direct_Property_Should_Have_OwnerType_Set
public void AddOwnered_Direct_Property_Should_Have_OwnerType_Set()
{
var p1 = new PerspexProperty<string>("d1", typeof(Class1), o => null, (o, v) => { });
var p2 = p1.AddOwner<Class3>(o => null, (o, v) => { });
Assert.Equal(typeof(Class3), p2.OwnerType);
}
示例5: AddOwnered_Direct_Property_Should_Equal_Original
public void AddOwnered_Direct_Property_Should_Equal_Original()
{
var p1 = new PerspexProperty<string>("d1", typeof(Class1), o => null, (o,v) => { });
var p2 = p1.AddOwner<Class3>(o => null, (o, v) => { });
Assert.Equal(p1, p2);
Assert.Equal(p1.GetHashCode(), p2.GetHashCode());
Assert.True(p1 == p2);
}
示例6: AddOwnered_Properties_Should_Share_Observables
public void AddOwnered_Properties_Should_Share_Observables()
{
var p1 = new PerspexProperty<string>("p1", typeof(Class1));
var p2 = p1.AddOwner<Class3>();
Assert.Same(p1.Changed, p2.Changed);
Assert.Same(p1.Initialized, p2.Initialized);
}
示例7: AddOwnered_Property_Should_Have_OwnerType_Set
public void AddOwnered_Property_Should_Have_OwnerType_Set()
{
var p1 = new PerspexProperty<string>("p1", typeof(Class1));
var p2 = p1.AddOwner<Class3>();
Assert.Equal(typeof(Class3), p2.OwnerType);
}
示例8: AddOwnered_Property_Should_Equal_Original
public void AddOwnered_Property_Should_Equal_Original()
{
var p1 = new PerspexProperty<string>("p1", typeof(Class1));
var p2 = p1.AddOwner<Class3>();
Assert.Equal(p1, p2);
Assert.Equal(p1.GetHashCode(), p2.GetHashCode());
Assert.True(p1 == p2);
}