Building a workflow designer with Silverlight (eight)

Source: Internet
Author: User

Source code Download: http://www.shareidea.net/opensource.htm

Online Demo: http://www.shareidea.net/workflow.htm

Video Tutorials: http://www.shareidea.net/video/sharedesigner/sharedesigner.htm

This article source address: http://www.cnblogs.com/chegan/archive/2009/05/04/1448515.htm

Starting from this version, this program is named SHAREDESINER.S

This chapter is mainly to enhance the user experience features, including: 1, supporting the selection of objects (including the mouse and keyboard two ways, similar to the way Windows select multiple files). 2, support the selected object group movement. 3, support the selected objects copy and paste (activities and rules). 4, Support more keyboard operation Ctr+a (select All), Ctr+c (copy), Ctr+v (paste), ctr+z (fallback), delete (delete). 5, More right button menu. If you don't have the patience to continue looking down, see the video tutorial above.

Six enhancements to the user Experience feature

6.1 Support for selecting multiple objects

For selecting multiple objects, we can refer to how multiple files are selected in Windows. Includes two ways:

Hold down the CTRL key, and then click the selected file with the mouse one at a time, and the selected file is displayed in a different color.

Press the left mouse button, then drag the mouse, draw a rectangle on the screen, the file in the rectangle is selected and displayed in a different color.

We add an attribute isselectd to the activity and rule to indicate whether the object is selected. If selected, the background color is used to distinguish the color of objects that are not selected. As shown in the following illustration:

Also, add a property currentselectedcontrolcollection to the container class to store the currently selected collection of objects.

For the first method, write code in the object's MouseLeftButtonDown, setting the object's isselected=! IsSelected, adding the object to the Currentselectedcontrolcollection collection of the container.

For the second method, first of all, according to the mouse in the container drag and drop action to draw the corresponding rectangle, when the mouse is released, traversing the current all the objects in the container, check whether the object in the mouse painted rectangular area, if in, then set the object of the Isselected=true, and add the object to the container's property currentselectedcontrolcollection. As shown in the following illustration:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.