コード例 #1
0
 private void Paint(ButtonRender view)
 {
     this.Layer.CornerRadius    = (float)view.CustomBorderRadius;
     this.Layer.BorderColor     = view.CustomBorderColor.ToCGColor();
     this.Layer.BackgroundColor = view.CustomBackgroundColor.ToCGColor();
     this.Layer.BorderWidth     = (int)view.CustomBorderWidth;
 }
コード例 #2
0
        private void Paint(ButtonRender view)
        {
            _gradientBackground = new GradientDrawable();
            _gradientBackground.SetShape(ShapeType.Rectangle);
            _gradientBackground.SetColor(view.CustomBackgroundColor.ToAndroid());

            // Thickness of the stroke line
            _gradientBackground.SetStroke((int)view.CustomBorderWidth, view.CustomBorderColor.ToAndroid());

            // Radius for the curves
            _gradientBackground.SetCornerRadius(
                DpToPixels(this.Context, Convert.ToSingle(view.CustomBorderRadius)));

            // set the background of the label
            Control.SetBackground(_gradientBackground);
        }
コード例 #3
0
 public ActionResult Button(ButtonRender render)
 {
     if (render.Invisible)    //不可见
     {
         render.HasPermission = false;
     }
     else
     {
         if (!render.PermissionKey.IsEmpty())
         {
             render.HasPermission = employee.HasPermission(render.PermissionKey);
         }
         else
         {
             render.HasPermission = true;
         }
     }
     return(View(render));
 }