🏗️
MauiReactor
  • What is MauiReactor?
  • What's new in Version 2
  • What's new in Version 3
  • Getting Started
  • Getting Started Version 2
  • Components
    • State-less Components
    • Stateful Components
      • Inline Components
    • Component life-cycle
    • Component Properties
    • Component with children
    • Component Parameters
    • Theming
    • Navigation
      • NavigationPage
      • Shell
      • Back button
    • Controls
      • Button
      • RadioButton
      • FlyoutPage
      • CollectionView
        • Interactions
        • Layout
        • Selection
        • Empty view
        • Scrolling
        • Grouping
      • IndicatorView
      • Picker
      • Shell
      • Label
    • Wrap 3rd party controls
      • Lottie animations
      • Provide DataTemplate to native controls
    • Accessing native controls
    • Animation
      • Property-Based
      • AnimationController
      • Timer
    • Graphics
      • CanvasView control
    • Window
    • Testing
    • XAML Integration
  • Deep dives
    • Native tree and Visual tree
    • Dependency injection
    • Working with the GraphicsView
    • Migrating from MVVM Model
    • Using XAML Resources
    • Behaviors
  • resources
    • Source and Sample Applications
  • Q&A
    • How to deal with state shared across Components?
    • Does this support ObservableCollection for CollectionView?
    • Do we need to add states to create simple animations such as ScaleTo, FadeTo, etc on tap?
    • How to deal with custom dialogs/popups?
  • How to create a Menu/ContextMenu?
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub
  1. Components

Graphics

This page enumerates the options you have to to draw directly on a canvas in MauiReactor

PreviousTimerNextCanvasView control

Last updated 2 years ago

Was this helpful?

Sometimes you want to directly just draw lines, text, or shapes in general inside a blank canvas. Drawing directly has some advantages:

  • You can follow UI designs at the pixel level, for example, you can perfectly round corners at the required value or use the same shadow color as specified in a Figma project

  • You need to boost your application performance, especially when dealing with a lot of views present at the same time on a page

  • You require that a specific control or group of controls have exactly the same appearance among all platforms

Some disadvantages:

  • Often dealing with low-level commands like DrawLine or DrawString results in a more complex code to write a text

  • Is sometimes difficult to handle correctly all the user interactions as the native control does: take for example the simple Button view that appears and behaves differently under Android and iOS

MauiReactor features a complete set of tools that allows you to write graphics objects and different levels of abstraction.

From the higher level to the lower:

  • Using the MauiReactor CanvasView allows declaring graphics objects and interacting with them like any MauiReactor visual node

  • Using GraphicsView standard MAUI control as described

  • Using SkiaSharp package to directly issue commands to a Skia canvas

here