title: dynamic gradient with skiasharp
body: <p>I have created a control using SkiaSharp so I can have agradient toolbar, I have tried many nuggets but all of them failed in setting the color to Dynamic and all have this as reported bug. The only way it works is to set the color as static resource instead of dynamic. So I have tried Skia however I have the same issue</p>
  <p>my control</p>
  <pre><code> public partial class ControlBar : ContentView
      {
          public Color StartColor { get; set; }
          public Color EndColor { get; set; } = Color.Transparent;
          public bool Horizontal { get; set; } = false;
  
          public ControlBar()
          {
              InitializeComponent();
  
              SKCanvasView canvasView = new SKCanvasView();
              canvasView.PaintSurface += OnCanvasViewPaintSurface;
              Content = canvasView;
          }
  
          void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs args)
          {
              SKImageInfo info = args.Info;
              SKSurface surface = args.Surface;
              SKCanvas canvas = surface.Canvas;
  
              canvas.Clear();
  
              var colors = new SKColor[] {StartColor.ToSKColor(), EndColor.ToSKColor()};
              SKPoint startPoint = new SKPoint(0, 0);
              SKPoint endPoint = Horizontal ? new SKPoint(info.Width, 0) : new SKPoint(0, info.Height);
  
              var shader = SKShader.CreateLinearGradient(startPoint, endPoint, colors, null, SKShaderTileMode.Clamp);
  
              SKPaint paint = new SKPaint
              {
                  Style = SKPaintStyle.Fill,
                  Shader = shader
              };
  
              canvas.DrawRect(new SKRect(0, 0, info.Width, info.Height), paint);
          }
  
      }
  </code></pre>
  <p>USAGE</p>
  <pre><code>&lt;ContentPage xmlns=&quot;http://xamarin.com/schemas/2014/forms&quot;
               xmlns:x=&quot;http://schemas.microsoft.com/winfx/2009/xaml&quot;
               xmlns:local=&quot;clr-namespace:WorkTestApp&quot;
               x:Class=&quot;WorkTestApp.MainPage&quot;&gt;
      &lt;StackLayout&gt;
          &lt;local:ControlBar StartColor=&quot;{DynamicResource MediumColor}&quot; EndColor=&quot;Green&quot; /&gt;
          &lt;!-- Place new controls here --&gt;
          &lt;Label Text=&quot;Welcome to Xamarin.Forms!&quot; 
             HorizontalOptions=&quot;Center&quot;
             VerticalOptions=&quot;CenterAndExpand&quot; /&gt;
      &lt;/StackLayout&gt;
  &lt;/ContentPage&gt;
  </code></pre>
  <p>I am getting underline under Dynamic resource that <code>{DynamicResource} can only be used with dependency property</code>how can I solve this?</p>