Skip to content

@GettingStarted~Mac

XDeveloper edited this page Aug 29, 2018 · 1 revision

Getting Started with Xamarin.Mac

  1. Create a Xamarin.Mac project. Choose a Cocoa App to start.

Create

  1. After going through the configuration window, open the Add Packages... window and install CSharpMath.SkiaSharp and SkiaSharp.Views.

Add package Install CSharpMath Install SkiaSharp

  1. After installation, open ViewController.cs.

Open file

  1. Add
var mathPainter = new CSharpMath.SkiaSharp.MathPainter(80) { LaTeX = "1+1=2" };
var mathView = new SkiaSharp.Views.Mac.SKCanvasView();
mathView.PaintSurface += (sender, e) =>
{
    e.Surface.Canvas.Clear();
    mathPainter.Draw(e.Surface.Canvas);
};
View = mathView;

below // Do any additional setup after loading the view. under the ViewDidLoad() method.

Add code

  1. Click the arrow button to run.

Result

  1. Discover what you can do