예제 #1
0
파일: Control.binding.cs 프로젝트: Exe0/Eto
		/// <summary>
		/// Adds a new dual binding between the control and the specified source binding
		/// </summary>
		/// <param name="widgetPropertyName">Property on the control to update</param>
		/// <param name="sourceBinding">Binding to get/set the value to from the control</param>
		/// <param name="mode">Mode of the binding</param>
		/// <returns>A new instance of the DualBinding class that is used to control the binding</returns>
		public DualBinding Bind(string widgetPropertyName, DirectBinding sourceBinding, DualBindingMode mode = DualBindingMode.TwoWay)
		{
			var binding = new DualBinding(
				sourceBinding,
				new ObjectBinding(this, widgetPropertyName),
				mode
			);
			Bindings.Add(binding);
			return binding;
		}
예제 #2
0
파일: Control.binding.cs 프로젝트: Exe0/Eto
		/// <summary>
		/// Adds a new dual binding between the control and the specified object
		/// </summary>
		/// <param name="propertyName">Property on the control to update</param>
		/// <param name="source">Object to bind to</param>
		/// <param name="sourcePropertyName">Property on the source object to retrieve/set the value of</param>
		/// <param name="mode">Mode of the binding</param>
		/// <returns>A new instance of the DualBinding class that is used to control the binding</returns>
		public DualBinding Bind(string propertyName, object source, string sourcePropertyName, DualBindingMode mode = DualBindingMode.TwoWay)
		{
			var binding = new DualBinding(
				source,
				sourcePropertyName,
				this,
				propertyName,
				mode
			);
			Bindings.Add(binding);
			return binding;
		}