verybadcat/CSharpMath

Hello, I would like to know if it works in WPF.

pomaton12 opened this issue · 4 comments

Hello, I would like to know if CSharpMath works in C# WPF to render Formulas.

Yes, skiasharp works on wpf so use that and draw on the canvas as in the main .md instructions.

` public MainWindow()
{
InitializeComponent();

        var painter = new CSharpMath.Forms.MathView
        {
            LaTeX = "a_b",
        };

        MyPanel.Children.Add(painter);

    }`

I am trying to add a formula to a MyPanel canvas panel in c# wpf

I have the ERROR message: cannot convert from 'CSharpMath.Forms.MathView' to 'System.Windows.UIElement'

Don't use Forms as that refers to Xamarin.Forms.
Instead use Skiasharp and see the skiasharp instructions.
Perhaps first read the general skiasharp instructions for wpf, and when you have done something simple like drawing a square, then come back here and create a MathPainter and draw a formula.

Answered