/// <summary>
 /// Handles the OnMouseButtonDown event of the MainGrid control. Captures the mouse and sets the current
 /// value to the click point. If the textbox currently is active, it is made inactive.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
 private void MainGrid_OnMouseButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (e.LeftButton == MouseButtonState.Pressed)
     {
         IsPressed = true;
         this.MainGrid.CaptureMouse();
         this.Command.Execute("+" + CommandParameter.ToString());
     }
 }
Exemplo n.º 2
0
 public override string ToString()
 {
     return(string.Format("(Optional: {0}, NonOptional: {1})", Optional.ToString(), NonOptional.ToString()));
 }
Exemplo n.º 3
0
        public string Get(string propertyName)
        {
            switch (propertyName)
            {
            //ELEMENT
            case nameof(ClassId):
                return(ClassId.ToString());

            case nameof(AutomationId):
                return(AutomationId.ToString());

            case nameof(Id):
                return(Id.ToString());

            case nameof(StyleId):
                return(StyleId.ToString());

            //VISUAL ELEMENT
            case nameof(AnchorX):
                return(AnchorX.ToString());

            case nameof(AnchorY):
                return(AnchorY.ToString());

            case nameof(BackgroundColor):
                return(BackgroundColor.ToHex());

            case nameof(Width):
                return(this.Width.ToString());

            case nameof(Height):
                return(this.Height.ToString());

            case nameof(IsEnabled):
                return(IsEnabled.ToString());

            case nameof(WidthRequest):
                return(this.WidthRequest.ToString());

            case nameof(HeightRequest):
                return(this.HeightRequest.ToString());

            case nameof(IsFocused):
                return(IsFocused.ToString());

            case nameof(IsVisible):
                return(IsVisible.ToString());

            case nameof(InputTransparent):
                return(InputTransparent.ToString());

            case nameof(X):
                return(this.X.ToString());

            case nameof(Y):
                return(this.Y.ToString());

            case nameof(Opacity):
                return(this.Opacity.ToString());

            case nameof(TranslationX):
                return(this.TranslationX.ToString());

            case nameof(TranslationY):
                return(this.TranslationY.ToString());

            case nameof(Rotation):
                return(this.Rotation.ToString());

            case nameof(RotationX):
                return(this.RotationX.ToString());

            case nameof(RotationY):
                return(this.RotationY.ToString());

            case nameof(Scale):
                return(this.Scale.ToString());

            //VIEW
            case nameof(Margin):
                return(this.Margin.ToString());

            case nameof(VerticalOptions):
                return(this.VerticalOptions.ToString());

            case nameof(HorizontalOptions):
                return(this.HorizontalOptions.ToString());

            //BUTTON
            case nameof(BorderColor):
                return(BorderColor.ToHex());

    #pragma warning disable CS0618 // Type or member is obsolete
            case nameof(BorderRadius):
                return(BorderRadius.ToString());

    #pragma warning restore CS0618 // Type or member is obsolete
            case nameof(BorderWidth):
                return(BorderWidth.ToString());

            case nameof(CornerRadius):
                return(CornerRadius.ToString());

            case nameof(CommandParameter):
                return(CommandParameter.ToString());

            case nameof(FontAttributes):
                return(FontAttributes.ToString());

            case nameof(FontFamily):
                return(FontFamily);

            case nameof(FontSize):
                return(FontSize.ToString());

            case nameof(TextColor):
                return(TextColor.ToHex());

            case nameof(Text):
                return(Text);

            default:
                return(string.Empty);
            }
        }
 /// <summary>
 /// Handles the OnMouseButtonUp event of the MainGrid control.
 /// </summary>
 /// <param name="sender">The source of the event.</param>
 /// <param name="e">The <see cref="MouseButtonEventArgs"/> instance containing the event data.</param>
 private void MainGrid_OnMouseButtonUp(object sender, MouseButtonEventArgs e)
 {
     this.MainGrid.ReleaseMouseCapture();
     IsPressed = false;
     this.Command.Execute("-" + CommandParameter.ToString());
 }
Exemplo n.º 5
0
 public override string ToString()
 {
     return(string.Format("[Name: {0}, Value: {1}, Parsed: {2}, Parameter: {3}, Offset: {4}]",
                          Name, Value, (Parsed != null? Parsed.ToString(): ""), (IsMapped? Parameter.ToString(): ""), Offset.ToString()));
 }