1

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?

ScottN
  • 1,490
  • 2
  • 20
  • 34
  • 1
    -1: Link doesn't work. We can't allow image rot to make Stack Overflow like so many forums with once useful content made worthless by a series of broken images. – Chris Wood Aug 12 '14 at 08:31
  • I agree, the question was from years ago and I now know to post content that will continue to be available in the questions and answers. From what I remember the picture was a screenshot of the warning box mentioned. It's pretty common thing in the Expression Blend world, nothing special. – ScottN Aug 12 '14 at 14:54

1 Answers1

2

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
  • 16,679
  • 4
  • 49
  • 69
  • 1
    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 Apr 15 '10 at 22:12
  • @Sentax What type of object is your control's parent? – Michael Todd Apr 15 '10 at 22:49
  • 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 Apr 15 '10 at 23:35
  • @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 Apr 16 '10 at 03:21