示例#1
0
文件: BindingTest.cs 项目: dfr0/moon
		public void DPWithDefaultValueFE_UseTargetNull ()
		{
			var o = new DPWithDefaultValueFrameworkElement { DataContext = new Rectangle { } };
			BindingOperations.SetBinding (o, DPWithDefaultValueFrameworkElement.DefaultValueProperty, new Binding ("DataContext") { });
			Assert.AreEqual (null, o.GetValue (DPWithDefaultValueFrameworkElement.DefaultValueProperty), "#1");
		}
示例#2
0
文件: BindingTest.cs 项目: dfr0/moon
		public void DPWithDefaultValueFE_Broken_UseTargetNull ()
		{
			var o = new DPWithDefaultValueFrameworkElement { };
			BindingOperations.SetBinding (o, DPWithDefaultValueFrameworkElement.DefaultValueProperty, new Binding { TargetNullValue = "Foo" });
			Assert.AreEqual ("Foo", o.GetValue (DPWithDefaultValueFrameworkElement.DefaultValueProperty), "#1");
		}
示例#3
0
文件: BindingTest.cs 项目: dfr0/moon
		public void DPWithDefaultValueFE_Broken_DoNotUseFallback ()
		{
			var o = new DPWithDefaultValueFrameworkElement { };
			BindingOperations.SetBinding (o, DPWithDefaultValueFrameworkElement.DefaultValueProperty, new Binding { FallbackValue = "Foo" });
			Assert.AreEqual (DPWithDefaultValueFrameworkElement.Value, o.GetValue (DPWithDefaultValueFrameworkElement.DefaultValueProperty), "#1");
		}