Xamarin Forms (Windows) System.Windows.Point

125 views Asked by At

I'm fairly new to Xamarin and this could be a double up. I'm building some round images in my cross platform APP and I have found the below tutorial to assist me however I'm having an issue with the windows section of the code. Here is the tutorial link:

https://blog.xamarin.com/elegant-circle-images-in-xamarin-forms/

Here is the code I'm having the problem with:

protected override void OnElementPropertyChanged(object sender,System.ComponentModel.PropertyChangedEventArgs e)
    {
      base.OnElementPropertyChanged(sender, e);
      if (Control != null && Control.Clip == null)
      {
    var min = Math.Min(Element.Width, Element.Height) / 2.0f;
    if (min <= 0)
      return;
    Control.Clip = new EllipseGeometry
    {
      Center = new System.Windows.Point(min, min),
      RadiusX = min,
      RadiusY = min
    };
  }
}

The first issue I have when using the code is when I place this code into my Windows phone directory the error was that "System.Windows.Point" is not part of "System.Windows".

Second issue I have is after a little digging I found by adding "WindowsBase.dll" to the references this allowed me to add .Point to System.Windows, however this caused a second issue. The first error has disappeared but now the error I get is "Cannot implicitly convert type 'System.Windows.Point' to 'Windows.Foundation.Point'."

Any assistance on the above would be great thanks in advance.

0

There are 0 answers