Пример #1
0
        /// <summary>
        /// Handle when dependency property value changes to update the underline HtmlContainer with the new value.
        /// </summary>
        private static void OnPerspexProperty_valueChanged(PerspexObject PerspexObject, PerspexPropertyChangedEventArgs e)
        {
            var control = PerspexObject as HtmlLabel;

            if (control != null)
            {
                if (e.Property == AutoSizeProperty)
                {
                    if ((bool)e.NewValue)
                    {
                        PerspexObject.SetValue(AutoSizeHeightOnlyProperty, false);
                        control.InvalidateMeasure();
                        control.InvalidateVisual();
                    }
                }
                else if (e.Property == AutoSizeHeightOnlyProperty)
                {
                    if ((bool)e.NewValue)
                    {
                        PerspexObject.SetValue(AutoSizeProperty, false);
                        control.InvalidateMeasure();
                        control.InvalidateVisual();
                    }
                }
            }
        }
Пример #2
0
            public bool SetValue(object value)
            {
                if (!_property.IsReadOnly)
                {
                    _instance.SetValue(_property, value);
                    return(true);
                }

                return(false);
            }
Пример #3
0
 public static void SetRowSpan(PerspexObject element, int value)
 {
     element.SetValue(RowSpanProperty, value);
 }
Пример #4
0
 public static void SetColumn(PerspexObject element, int value)
 {
     element.SetValue(ColumnProperty, value);
 }
Пример #5
0
 /// <summary>
 /// Sets the value of the Top attached property for a control.
 /// </summary>
 /// <param name="element">The control.</param>
 /// <param name="value">The top value.</param>
 public static void SetTop(PerspexObject element, double value)
 {
     element.SetValue(TopProperty, value);
 }
Пример #6
0
 /// <summary>
 /// Sets the value of the Left attached property for a control.
 /// </summary>
 /// <param name="element">The control.</param>
 /// <param name="value">The left value.</param>
 public static void SetLeft(PerspexObject element, double value)
 {
     element.SetValue(LeftProperty, value);
 }
Пример #7
0
 /// <summary>
 /// Sets the value of the Bottom attached property for a control.
 /// </summary>
 /// <param name="element">The control.</param>
 /// <param name="value">The bottom value.</param>
 public static void SetBottom(PerspexObject element, double value)
 {
     element.SetValue(BottomProperty, value);
 }
Пример #8
0
 public static void SetHotKey(PerspexObject target, KeyGesture value) => target.SetValue(HotKeyProperty, value);
Пример #9
0
 /// <summary>
 /// Handle when dependency property value changes to update the underline HtmlContainer with the new value.
 /// </summary>
 private static void OnPerspexProperty_valueChanged(PerspexObject PerspexObject, PerspexPropertyChangedEventArgs e)
 {
     var control = PerspexObject as HtmlLabel;
     if (control != null)
     {
         if (e.Property == AutoSizeProperty)
         {
             if ((bool)e.NewValue)
             {
                 PerspexObject.SetValue(AutoSizeHeightOnlyProperty, false);
                 control.InvalidateMeasure();
                 control.InvalidateVisual();
             }
         }
         else if (e.Property == AutoSizeHeightOnlyProperty)
         {
             if ((bool)e.NewValue)
             {
                 PerspexObject.SetValue(AutoSizeProperty, false);
                 control.InvalidateMeasure();
                 control.InvalidateVisual();
             }
         }
     }
 }
Пример #10
0
 public static void SetHotKey(PerspexObject target, KeyGesture value) => target.SetValue(HotKeyProperty, value);
Пример #11
0
 /// <summary>
 /// Sets the value of the Top attached property for a control.
 /// </summary>
 /// <param name="element">The control.</param>
 /// <param name="value">The top value.</param>
 public static void SetTop(PerspexObject element, double value)
 {
     element.SetValue(TopProperty, value);
 }
Пример #12
0
 /// <summary>
 /// Sets the value of the Left attached property for a control.
 /// </summary>
 /// <param name="element">The control.</param>
 /// <param name="value">The left value.</param>
 public static void SetLeft(PerspexObject element, double value)
 {
     element.SetValue(LeftProperty, value);
 }
Пример #13
0
 /// <summary>
 /// Sets the value of the Bottom attached property for a control.
 /// </summary>
 /// <param name="element">The control.</param>
 /// <param name="value">The bottom value.</param>
 public static void SetBottom(PerspexObject element, double value)
 {
     element.SetValue(BottomProperty, value);
 }
Пример #14
0
 /// <summary>
 /// Sets the value of the Column attached property for a control.
 /// </summary>
 /// <param name="element">The control.</param>
 /// <param name="value">The column value.</param>
 public static void SetColumn(PerspexObject element, int value)
 {
     element.SetValue(ColumnProperty, value);
 }
Пример #15
0
 // ReSharper disable once UnusedMember.Global
 public static void SetDock(PerspexObject element, Dock dock)
 {
     element.SetValue(DockProperty, dock);
 }
Пример #16
0
 /// <summary>
 /// Sets the value of the RowSpan attached property for a control.
 /// </summary>
 /// <param name="element">The control.</param>
 /// <param name="value">The row span value.</param>
 public static void SetRowSpan(PerspexObject element, int value)
 {
     element.SetValue(RowSpanProperty, value);
 }
Пример #17
0
 public static void SetDock(PerspexObject element, Dock dock)
 {
     element.SetValue(DockProperty, dock);
 }