Skip to content
Mircea Staicu edited this page Jul 9, 2021 · 18 revisions

Welcome to the RichCanvas wiki!

Table of contents

Requirements

IDE .NET C#

Install RichCanvas from Nuget

Download Package

Install-Package RichCanvas

Quick start

Decalre the namespace: clr-namespace:RichCanvas;assembly=RichCanvas

Use the following XAML:

<richcanvas:RichItemsControl></richcanvas:RichItemsControl>

Now you have a canvas with panning, zooming, scrolling and selecting.

Common XAML structure for MVVM:

<richCanvas:RichItemsControl ItemsSource="{Binding Items}">

            <richCanvas:RichItemsControl.Resources>


                <DataTemplate DataType="{x:Type vm:Rectangle}">
                    <Rectangle Fill="Red"
                               Width="{Binding Width}"
                               Height="{Binding Height}"></Rectangle>
                </DataTemplate>

            </richCanvas:RichItemsControl.Resources>

            <richCanvas:RichItemsControl.ItemContainerStyle>
                <Style TargetType="richCanvas:RichItemContainer">

                    <Setter Property="Width"
                            Value="{Binding Width, Mode=TwoWay}" />
                    <Setter Property="Height"
                            Value="{Binding Height, Mode=TwoWay}" />

                </Style>
            </richCanvas:RichItemsControl.ItemContainerStyle>

        </richCanvas:RichItemsControl>