Haven't updated the blog for a long time, today if not urgent, ready to three rounds, fully explain the most cow blend elements-"fluidmovebehavior". I assure you that these three chapters must be very wonderful, not to see you certainly regret . I believe that after the publication of these three articles, many of the domestic Silverlight and WPF works will be filled with a variety of flying, floating cool effects, as well as the smooth movement of elements of the scroll bar. Your customers will be amazed that the software can be so flashy. And what's even more amazing is that it's really very, very simple to achieve these effects, and one line of code doesn't have to be written.
Many programmers don't know about blend, and of course fewer people know fluidmovebehavior. Fluidmovebehavior, like his name, attaches him to the flow of all elements, such as:
In the sixth Chapter we talked about using the Wrappanle construct the listbox, I made some minor changes to him, so that when he changed the size of the container, all the elements in the listbox would float to his position in a flowing way. The procedure is very simple, first right-click the listbox in the pop-up menu, select Edit Additional templates->edit Layout of Items->editcurrent, Enter Itemspaneltemplate edit mode.
Here we can see WrapPanel ( originally Stackpanle, but in the sixth chapter we changed it to WrapPanel). First select WrapPanel.
Then in the Assets panel, select behaviors->fluidmovebehavior. Double-click on it and he will automatically attach it to the WrapPanel we just selected.
If you do it right, you should get the effect in.
Then click Fluidmovebehavior and set the AppliesTo property to childrenin the Properties panel on the right.
Exits the current template editing mode. Congratulations, your first floating, moving listbox has been completed. It is important to note that you should check the listbox, do not specify a width for him, and set horizontalalignment= "Stretch" so that he will follow the size of the container changes. Click F5 to run, and then try to change the size of IE. You can see the effect.
SOURCE download
Reprint article Source: http://www.cnblogs.com/kaodigua/archive/2011/03/02/1968726.html