views:

138

answers:

1

Hi there.

I'm editing a ListViewItem template and I'm trying to add a custom control to the template but when I do I get a warning box surrounding my control that I add.

Here is the pic.

Notice the image isn't re-sizing that is part of the custom control.

Why is this happening to my control? I've used this control many times in my application with no problems re-sizing, etc., why the problems in the template?

+1  A: 

You just have to rebuild the application. Blend is telling you it's not sure what you're referring to.

UPDATE: On re-reading your post, now I'm not sure that a rebuild will work. I'll wait to see what rebuilding does (since that's always worked for me), then respond with further help.

Michael Todd
Your right! I was re-building the project in Visual Studio and then going to Expression Blend, I had to build it IN Expression Blend for it to work. But I do have another problem.. the control isn't being sized in my template as it would in the rest of my application...
ScottN
@Sentax What type of object is your control's parent?
Michael Todd
@Michael, CustomControl parent is Canvas, Canvas parent is the Template. If I add my CustomControl to say a Window with a canvas, I can re-size the CustomControl and the images get re-sized correctly because of the binding width/height values in the CustomControl. Just not in the template. It's very strange. Also in the Template, I don't see the image of my CustomControl, just the boundaries of the control where I can size it. Very strange behavior.
ScottN
@Sentax I don't _know_ that changing your Canvas to a Grid (even a grid without defined rows/columns) will solve your issue, but every time I've switched from a StackPanel or Canvas to a Grid, I've gotten more expected behavior from my controls. I believe it has to do with the fact that a Grid stretches to its container, so any control inside it acts "like it should" rather than having to worry about defining widths/heights for it. Give it a try and see if it helps.
Michael Todd