Prev | Current Page 236 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"

Once an element is selected, it can be
moved, resized, or deleted.
None The InkCanvas ignores mouse and stylus input.
CHAPTER 4 n LAYOUT 110
The InkCanvas raises events when the editing mode changes (ActiveEditingModeChanged), a
gesture is detected in GestureOnly or InkAndGesture mode (Gesture), a stroke is drawn
(StrokeCollected), a stroke is erased (StrokeErasing and StrokeErased), and an element is
selected or changed in Select mode (SelectionChanging, SelectionChanged, SelectionMoving,
SelectionMoved, SelectionResizing, and SelectionResized). The events that end in ing represent
an action that is about to take place but can be canceled by setting the Cancel property of
the EventArgs object.
In Select mode, the InkCanvas provides a fairly capable design surface for dragging content
around and manipulating it. Figure 4-19 shows a Button control in an InkCanvas as it??™s
being selected (on the left) and then repositioned and resized (on the right).
Figure 4-19.Moving and resizing an element in the InkCanvas
As interesting as Select mode is, it isn??™t a perfect fit if you??™re building a drawing or diagramming
tool. You??™ll see a better example of how to create a custom drawing surface in
Chapter 14.
Layout Examples
You??™ve now spent a considerable amount of time poring over the intricacies of the WPF layout
containers.


Pages:
224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248