Esempio n. 1
0
		/// <summary>
		/// ContentProperty property changed handler.
		/// </summary> 
		/// <param name="d">ContentControl that changed its Content.</param>
		/// <param name="e">DependencyPropertyChangedEventArgs.</param>
		private static void OnRightPropertyChanged (IDependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			Canvas source = d as Canvas;
			Debug.Assert (source != null, "The source is not an instance of ContentControl!");
			// Notify derived classes of the change 
			source.OnRightChanged (e.OldValue, e.NewValue);
		}
Esempio n. 2
0
 private static void OnTriggersChanged(IDependencyObject obj, DependencyPropertyChangedEventArgs args)
 {
     var triggerCollection1 = args.OldValue as TriggerCollection;
     var triggerCollection2 = args.NewValue as TriggerCollection;
     if (triggerCollection1 == triggerCollection2)
     {
         return;
     }
     if (triggerCollection1 != null && triggerCollection1.AssociatedObject != null)
     {
         triggerCollection1.Detach();
     }
     if (triggerCollection2 == null || obj == null)
     {
         return;
     }
     if (triggerCollection2.AssociatedObject != null)
     {
         throw new InvalidOperationException("Cannot attach TriggerCollection multiple imes");
     }
     var fElement = obj as FormElement;
     if (fElement == null)
     {
         throw new InvalidOperationException("Can only host TriggerCollection on FormElement");
     }
     triggerCollection2.Attach(fElement);
 }
Esempio n. 3
0
 /// <summary>
 /// Gets the TriggerCollection containing the triggers associated with the specified object.
 /// </summary>
 /// <param name="obj">The object from which to retrieve the triggers.</param>
 /// <returns>
 /// A TriggerCollection containing the triggers associated with the specified object.
 /// </returns>
 public static TriggerCollection GetTriggers(IDependencyObject obj)
 {
     var triggerCollection = (TriggerCollection) obj.GetValue(TriggersProperty);
     if (triggerCollection == null)
     {
         triggerCollection = new TriggerCollection();
         obj.SetValue(TriggersProperty, triggerCollection);
     }
     return triggerCollection;
 }
Esempio n. 4
0
 /// <summary>
 /// Attaches the specified <see cref="MvvmFx.Windows.IDependencyObject"/> to the collection
 /// </summary>
 /// <param name="dependencyObject">The <see cref="MvvmFx.Windows.IDependencyObject"/> to attach</param>
 public void Attach(IDependencyObject dependencyObject)
 {
     if (dependencyObject == AssociatedObject)
     {
         return;
     }
     if (AssociatedObject != null)
     {
         throw new InvalidOperationException("Cannot attach TriggerAction multiple times");
     }
     AssociatedObject = dependencyObject;
     OnAssociatedObjectChanged();
     OnAttached();
 }
Esempio n. 5
0
 public static void SetRow(IDependencyObject element, int value)
 {
     element.SetValue (RowProperty, value);
 }
Esempio n. 6
0
 public static int GetColumn(IDependencyObject element)
 {
     return (int) element.GetValue (ColumnProperty);
 }
Esempio n. 7
0
		public static void SetRowSpan(IDependencyObject element, object value) { element.SetValue(UIGrid.RowSpanProperty , value); }
Esempio n. 8
0
		public static void SetColumn(IDependencyObject element, object value) { element.SetValue(UIGrid.ColumnProperty , value); }
Esempio n. 9
0
		private static void OnRowColumnChanged( IDependencyObject o, DependencyPropertyChangedEventArgs e) 
		{
			Console.WriteLine(o);
			Console.WriteLine(e.NewValue + " : " + e.OldValue + " , " + e.Property);
		}
Esempio n. 10
0
		// A .NET property wrapper (not must)
		public static int GetRow (IDependencyObject element){return (int)element.GetValue(UIGrid.RowProperty );	}
Esempio n. 11
0
 public static int GetColumn(IDependencyObject element)
 {
     return((int)element.GetValue(ColumnProperty));
 }
Esempio n. 12
0
 public static void SetColumnSpan(IDependencyObject element, int value)
 {
     element.SetValue(ColumnSpanProperty, value);
 }
Esempio n. 13
0
		private static void OnTopPropertyChanged (IDependencyObject d, DependencyPropertyChangedEventArgs e)
		{
			var frame = d.Frame;
			frame.Y = float.Parse (e.NewValue.ToString ());
			d.Frame = frame;
		}
Esempio n. 14
0
 public static int GetRowSpan(IDependencyObject element)
 {
     return((int)element.GetValue(RowSpanProperty));
 }
Esempio n. 15
0
		public static void SetTop (IDependencyObject element, int value)
		{
			element.SetValue (Canvas.TopProperty, value);
		}
Esempio n. 16
0
		public static int GetTop (IDependencyObject element)
		{
			return (int)element.GetValue (Canvas.TopProperty);
		}
Esempio n. 17
0
 private static void OnRowColumnChanged( IDependencyObject o, DependencyPropertyChangedEventArgs e)
 {
 }
Esempio n. 18
0
 public static int GetRowSpan(IDependencyObject element)
 {
     return (int) element.GetValue (RowSpanProperty);
 }
Esempio n. 19
0
 public PropertyMetadata GetMetadata(IDependencyObject d)
 {
     if (metadataByType.ContainsKey (d.GetType()))
         return metadataByType[d.GetType()];
     return null;
 }
Esempio n. 20
0
 public static void SetColumnSpan(IDependencyObject element, int value)
 {
     element.SetValue (ColumnSpanProperty, value);
 }
Esempio n. 21
0
        public PropertyMetadata GetMetadata(IDependencyObject dependencyObject)
        {
            if (dependencyObject != null)
                return GetMetadata(dependencyObject.GetType());

            return null;
        }
Esempio n. 22
0
 /// <summary>
 /// Detaches the currently associated <see cref="MvvmFx.Windows.IDependencyObject"/>
 /// </summary>
 public void Detach()
 {
     OnDetaching();
     AssociatedObject = null;
     OnAssociatedObjectChanged();
 }
 /// <summary>
 /// Retrieves the default value of the current <see cref="DependencyProperty"/>.
 /// </summary>
 /// <param name="owner">The onwer of the dependency property.</param>
 /// <returns>Retrieves the default value of the property.</returns>
 internal abstract new TProperty GetPropertyDefault(IDependencyObject owner);