Getting started

This section contains some basic walkthroughs for XDraw.

Create you first drawing

After you have successfully installed XDraw, launch it from your Desktop or Programs Menu.

Now you see the main user interface which contains:
  • The Menu and Toolbar on top
  • Drawing Shape properties on the left
  • Drawing area in the middle
  • Project tree on the right

After starting XDraw it creates a new project automatically. But if you want to start a new Project I would recomment to click "File/New project" or the corresponding toolbar button to setup a new one.
A Dialog will pop up in which you can enter the project name and the xaml file name, wich will contain the ResourceDictionary. If you want to change these later, you can edit them if you select the project in the project tree.
The projects properties are shown just below the project tree.

All you need to do now is add a new Drawing with the green "+" Button on top of the project tree.
A new Drawing is created and automatically opend in the drawing area for you. A new drawing is created at a size of 1000x1000 units. You can change these if the drawing is selected just below the project tree.
There you can also change the drawings name and export format.

To add a shape to the drawing select the tool you want to use and left click/drag in the drawing area. The Edit tool will be activated automatically afterwards.
To move a shape click it and drag it at any position. To modify a shape click and drag one of the blue circles.

On the left pane you can see the properties of the shape. Stroke, Brush and Fill brush are available on all shapes.
Below of these the shapes special properties are displayed. For some shapes (like the Path) there are even different properties for the modifier circles. The selected circle is shown with a bold outline.

You can add as many shapes to a drawing as you whish.

You can also add multiple drawings to a project. You can open and switch between multiple drawings by using the tab header on top of the drawing area.

You dont need to save a single drawing before you close it in the drawing area. Saving affects always the whole project.
But be aware of the fact the XDraw does not contain change tracking so far. So it will not ask you to save if you exit XDraw or open an other project!

After saving your project you get an .xdprj and a .xaml file.
The .xaml file contains all the drawings. The .xdprj file contains some additional information like the size of the drawing area for each drawing.
To open the project you can load it with "File/Load" or doubleclick the .xdprj file in windows explorer.

Add your drawings to a Visual Studio project

  1. Open your WPF project in Visual Studio
  2. Right click the project in Solution explorer and select "Add/Existing item ...".
  3. Select the generated .xaml file (you can also add the .xdprj file if you wish)
The resource dictionary is now ready for use as if you would have created it directly with Visual Studio.

Use a drawing from the resource dicionary

The Drawings are stored as DrawingImage or Canvas in the ResourceDictionary (dependent on the export format you have choosen in XDraw.
The resouce key is the name you gave your drawing in XDraw.
The default is DrawingImage, so I will explain how you can add these to a window.
  • Add a new WPF Window to your project
  • Go to the XAML editor and add the following code as first node under the Window node
        <ResourceDictionary Source="ImageDictionary.xaml"/>
"ImageDictionary.xaml" is the file name of the .xaml file.
  • Now you can use the ImageDrawing like any other ImageSource object be referencing it by it's resource key
  <Image Source="{StaticResource DrawingImageKey}"/>
"DrawingImageKey" is the name of the Drawing you gave it in XDraw.

Last edited Nov 8, 2009 at 11:41 AM by osre, version 1


No comments yet.