示例#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
文件: Grid.cs 项目: KvanTTT/Perspex
 /// <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
文件: Grid.cs 项目: KvanTTT/Perspex
 /// <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);
 }