Skip to main content
Home Forums Silverlight Design Designing with Silverlight Manually edit 3 controls placed inside a ListBoxItem
8 replies. Latest Post by milind.soman on July 1, 2009.
(0)
bgnSL
Member
17 points
28 Posts
06-29-2009 8:39 AM |
I have a ListBox which items consists of 3 controls: TextBlock, Image and another TextBlock. All data is bound dinamically from the XML.
Does Blend 2.0 have the possibility of editing these 3 controls, e.g. open the project in Blend, select ListBox, Edit the layout of the Items and then move these 3 controls left and right or change its properties? Could not find the video or text tutorial on this issue. Binding data to the ListBox did not help me as data is not visible inside Blend.
I think that I heard Jessy Liberty saying that this "option will be implemented in the future versions of Blend" but I am not positively sure about it.
EDIT:
Forgot to say that I'll be making a custom control with a ListBox which items will consist of a couple of controls. I was asked if a designer will be able to open the custom control in Blend and change visual properties and position of the controls inside a ListBoxItem.
jay nana...
Contributor
3388 points
624 Posts
06-29-2009 9:07 AM |
Hi, while crafting for your control, do you make use of TemplatePart attribute. because I have created lot of custom controls and I was able to edit the controls inside DataTemplate.
06-29-2009 9:15 AM |
No, don't use TemplatePart attribute, but I have just created a couple of controls :).
Up till now I have only managed to edit custom control in a developer way: right-click on a ListBox -> Edit Other Templates -> Edit Generated Items-> Edit Template and switch view to a Split view to see which control I am editing (desing shows only an empty row although more Controls are bound to that row which can be seen from the XAML viewer). As I said this is slightly impractical for a designer. He would like to have all pictures and text visible inside of a design window. This is not possible right? Something like real-time binding (although I reluctantly use this term as I'm not sure if this is what I need :) )
06-30-2009 5:44 AM |
Hm, does anyone give me a hint if this will be available in Blend 3?
milind.s...
389 points
72 Posts
06-30-2009 10:28 AM |
Hi bgnSL,
As I understand, you have a listbox control inside which you are calling custom listbox item (which consists of a 2 text blocks and 1 image control). Now you want to adjust visual propertise of these 3 controls inside your custom listitem control. If my understanding is correct then Yes, you can open that custom control in blend & can edit it's visual propertise as well.
Your project will have a page.xaml with listbox inside it. A uc_listboxitem.xaml file with 2 text blocks & 1 image control inside it, all these controls are data binded with xml file. You will be populating this uc_listboxitem.xaml in list box of page.xaml.
06-30-2009 11:13 AM |
It seems that I've confused everyone and I'm sorry for that. I took a snapshot to better describe my issue.
When I edit the parts of a ListBox, I have to switch to a Split view in Blend to see which Control I am editing (textblock, image, or something else) because Blend shows only one row and placeholder for all Controls within that row. And this is OK with me.
BUT, this is not OK with our designer who is confused because he sees nothing in the design window. Is it possible to have these controls in the design windows as well, for example in this case the design windows would look like the other picture. Something like "real-time binding" so that the design window is populated with a real data.
In this respect I asked you "if this is not possible to achieve in Blend 2, will it be possible in Blend 3".
Thanks in advance and appologies again for such a confusing post :(
07-01-2009 12:13 AM |
The reason you are seeing this in single row is because, none of your controls are given height. You have given only width. Give some height that will comply with visual design, to each of the control.
You are databinding it on runtime, thats Ok. For designing & layouting purpose, you should have some temporary text added in textblocks & some temporary image source as well. Once your designer sees this temporary data he will be able to define visual propertise easily through Blend 2 itself.
07-01-2009 5:17 AM |
That's it! THANKS A LOT!
Hope the next Blend will be able to bind the data in real-time (so the Auto value of the height property will be more usefull), because I would't like my designer breaks my bindings in the code. In the meantime we'll work this way.
07-01-2009 5:32 AM |
Yes,
Blend 3 allows designers to bind data in both ways, live data as well as sample data which will get replaced with Live data on runtime. Blend 3 have lot of gr8 features to make designer developer collaboration more smoother.
You can have look at blend 3 & silverlight 3 features & demos at http://videos.visitmix.com/MIX09/Tags/Silverlight. Enjoy :)