This project is read-only.
March 11, 2013

New Features in Beta

I am finally able to release the first beta version of Xaml Helpmeet, officially version 0.5 Beta, and with the release I have made it available at Visual Studio Galleries so it may be downloaded and installed from within Visual Studio. This will also give users automatic notice of updates, if they configure Visual Studio for that feature.

This release fixes several minor bugs in the alpha releases, but the major changes in the code involve some reworking of some of the logic that was used to check if complete controls were selected. In previous versions for example if a command required a Grid control to be selected, the code would check to see if the first non-whitespace characters included an opening Grid tag, and that the last non-whitespace characters included a closing Grid tag. That worked well enough, but what to do if the opening tag and closing tags were not part of the same control? As far as I know no harm was done, if that occurred, but it bothered me.

In this code each time a command is given involving a selection, the code will parse the xaml to build a simple node tree with pointers into the document. What that is is easy then to determine what parts of a xaml document have been selected, so a determination can be made with regard to what the code should or should not do.

What that added it was not too difficult to add a few new features that I have been wanted to add since beginning this project. Three new commands have been added to the mix:
  • Expand selection
  • Contract selection
  • Select control
The idea behind "Expand selection" and "Contract selection" is to give the user a way to increase or decrease the size of selected text, but to do so in way that makes it easier to work with complete control items within the document. "Expand selection" will cause the area of selected text to grow larger to include the tags of the control that contains the selection. "Contract selection" works in the opposite direction, so in most respects it is the reverse of the other command. One difference though is that when a control is selected that contains more than one child node, the result of contraction will be that all of the child nodes will be selected.

And then when multiple nodes of a single parent are selected, "Contract selection" will drop one child at a time from the selection either from the start or the end of the selection. How does it know to drop a node from the top or from the bottom of the selection? That is determined by the nature of the selection. A selection consists of two end points. One is called the "anchor point," and the other is called the "active point." The anchor point is the starting point of the selection when created by dragging the mouse, and the active point is the end of the selection when the user releases the mouse button to stop the dragging action. If you look carefully, you can see the cursor flashing at the active point.

I chose to drop nodes closest to the anchor point, so that the active point would remain in place. I know some will wonder if I should not have allowed the active point to move and keep the anchor point anchored, but "anchor point" is only Microsoft's name for the point, not something enacted by congress. They could have just as easily have called it "the least important end point," and no one would realize that I was moving the anchor point. ;-)

The third command is similar to the first; so similar I may decided to remove it or the other after a while. Its purpose is to allow the user to point to a control in the xaml code, and select it by selecting the menu option. "Select control" is a little more forgiving than "Expand selection," but you can do just about the same thing with it. The implementation for the two commands are different, but most of the time, the result will be the same.

I do hope you will download Xaml Helpmeet and give it a try. If you like it, please give us a favorable review either here or at the Visual Studio Galleries to encourage others to try it. And if you have a problem using it, let us know that too. I enjoy working on this, but I need your help to find the bugs, and to let others know about it.

Thanks again for your interest in this code.

Last edited Mar 17, 2013 at 3:55 AM by gloder, version 1


No comments yet.