Skip to main content

Microsoft Silverlight

Answered Question Manually edit 3 controls placed inside a ListBoxItemRSS Feed

(0)

bgnSL
bgnSL

Member

Member

17 points

28 Posts

Manually edit 3 controls placed inside a ListBoxItem

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.

---
Click 'Mark as Answer' if my reply helped you!
Thanks

jay nanavati
jay nana...

Contributor

Contributor

3388 points

624 Posts

Re: Manually edit 3 controls placed inside a ListBoxItem

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.

Jay K Nanavaty
www.technologyopinion.com
Mark as answer if it helps. It will also help others...

bgnSL
bgnSL

Member

Member

17 points

28 Posts

Re: Re: Manually edit 3 controls placed inside a ListBoxItem

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 :) )

---
Click 'Mark as Answer' if my reply helped you!
Thanks

bgnSL
bgnSL

Member

Member

17 points

28 Posts

Re: Re: Re: Manually edit 3 controls placed inside a ListBoxItem

 Hm, does anyone give me a hint if this will be available in Blend 3?

---
Click 'Mark as Answer' if my reply helped you!
Thanks

milind.soman
milind.s...

Member

Member

389 points

72 Posts

Re: Manually edit 3 controls placed inside a ListBoxItem

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.

Please "Mark as Answer" if this answered your question.

Sr. User Experience Consultant
SpadeWorx Software Services,
Pune, India.

bgnSL
bgnSL

Member

Member

17 points

28 Posts

Re: Manually edit 3 controls placed inside a ListBoxItem

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 :(

---
Click 'Mark as Answer' if my reply helped you!
Thanks

milind.soman
milind.s...

Member

Member

389 points

72 Posts

Answered Question

Re: Manually edit 3 controls placed inside a ListBoxItem

Hi bgnSL,

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.

Please "Mark as Answer" if this answered your question.

Sr. User Experience Consultant
SpadeWorx Software Services,
Pune, India.

bgnSL
bgnSL

Member

Member

17 points

28 Posts

Re: Re: Manually edit 3 controls placed inside a ListBoxItem

That's it! THANKS A LOT! Big Smile

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.

---
Click 'Mark as Answer' if my reply helped you!
Thanks

milind.soman
milind.s...

Member

Member

389 points

72 Posts

Re: Re: Manually edit 3 controls placed inside a ListBoxItem

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 :)

Please "Mark as Answer" if this answered your question.

Sr. User Experience Consultant
SpadeWorx Software Services,
Pune, India.
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities