Example #1
0
        public Android.Graphics.Drawables.Drawable ToDrawable()
        {
            var drawable = new Microsoft.Maui.Graphics.MauiDrawable(MauiProgram.DefaultContext);

            drawable.SetBackgroundColor(Color.ToPlatform());
            return(drawable);
        }
Example #2
0
        public Android.Graphics.Drawables.Drawable ToDrawable()
        {
            var drawable = new Microsoft.Maui.Graphics.MauiDrawable();

            drawable.SetColor(Color.ToNative());
            return(drawable);
        }
Example #3
0
		public static Drawable? CreateDrawable(this PatternPaint patternPaint, Context? context)
		{
			var drawable = new MauiDrawable(context);
			drawable.SetBackground(patternPaint);

			return drawable;
		}
Example #4
0
		public static Drawable? CreateDrawable(this ImagePaint imagePaint, Context? context)
		{
			var drawable = new MauiDrawable(context);
			drawable.SetBackground(imagePaint);

			return drawable;
		}
        public static Drawable?CreateDrawable(this SolidPaint solidPaint, Context?context)
        {
            var drawable = new MauiDrawable(context);

            drawable.SetBackground(solidPaint);

            return(drawable);
        }
        public static Drawable?CreateDrawable(this PatternPaint patternPaint)
        {
            var drawable = new MauiDrawable();

            drawable.SetPaint(patternPaint);

            return(drawable);
        }
        public static Drawable?CreateDrawable(this ImagePaint imagePaint)
        {
            var drawable = new MauiDrawable();

            drawable.SetPaint(imagePaint);

            return(drawable);
        }
        public static Drawable?CreateDrawable(this SolidPaint solidPaint)
        {
            var drawable = new MauiDrawable();

            drawable.SetPaint(solidPaint);

            return(drawable);
        }
Example #9
0
		public static Drawable? CreateDrawable(this RadialGradientPaint radialGradientPaint, Context? context)
		{
			if (!radialGradientPaint.IsValid())
				return null;

			var drawable = new MauiDrawable(context);
			drawable.SetBackground(radialGradientPaint);

			return drawable;
		}
        public static Drawable?CreateDrawable(this LinearGradientPaint linearGradientPaint, Context?context)
        {
            if (!linearGradientPaint.IsValid())
            {
                return(null);
            }

            var drawable = new MauiDrawable(context);

            drawable.SetBackground(linearGradientPaint);

            return(drawable);
        }
        public static Drawable?CreateDrawable(this RadialGradientPaint radialGradientPaint)
        {
            if (!radialGradientPaint.IsValid())
            {
                return(null);
            }

            var drawable = new MauiDrawable();

            drawable.SetPaint(radialGradientPaint);

            return(drawable);
        }
        public static Drawable?CreateDrawable(this LinearGradientPaint linearGradientPaint)
        {
            if (!linearGradientPaint.IsValid())
            {
                return(null);
            }

            var drawable = new MauiDrawable();

            drawable.SetPaint(linearGradientPaint);

            return(drawable);
        }