ControlTemplate Frustration

D

DanThMan

I already abandoned using a UserControl because that crashes the
designer every time (though works when I run it). Now I'm having the
same problem trying to do the same thing with a ControlTemplate. I
guess (hope) all of this will be fixed when VS 2008 comes out, but
meanwhile, I struggle.

I created a ControlTemplate with a bunch of labels and a couple other
controls. I wanted all the labels in this ControlTemplate to have a
particular style, so, I built a Style with TargetType="Label" and no
x:Key (since I wanted the style to apply to *all* labels). No dice--
the designer wants an x:Key (error message: "Could not convert the
property '<key>' to a string"). As with the UserControl, works if I
run it but not in the designer.

If I add an x:Key, it will then work fine in the designer, but then I
have to manually set the style of every label to "{StaticResource
name_of_style}".

I know this is asking a lot, but it sure would be nice if I didn't
have to comment out a bunch of stuff to see my design. If you have any
helpful hints, please don't hold back.

Thx,

-Dan
 
P

Peter Duniho

[...]
I know this is asking a lot, but it sure would be nice if I didn't
have to comment out a bunch of stuff to see my design. If you have any
helpful hints, please don't hold back.

I don't know anything about using the control template. However, VS 2008
has been released. Have you tried it to see if your original problem has
been fixed? Assuming you filed a bug report when you originally ran into
the problem, and assuming that wasn't very close to the release date for
VS 2008, I'd expect them to have fixed it.

Pete
 
D

DanThMan

[...]
I know this is asking a lot, but it sure would be nice if I didn't
have to comment out a bunch of stuff to see my design. If you have any
helpful hints, please don't hold back.

I don't know anything about using the control template. However, VS 2008
has been released. Have you tried it to see if your original problem has
been fixed? Assuming you filed a bug report when you originally ran into
the problem, and assuming that wasn't very close to the release date for
VS 2008, I'd expect them to have fixed it.

Pete

Yeah, hopefully will be getting a copy soon. I just discovered this
particular issue today, so I never filed a bug report.
 
P

Peter Duniho

Yeah, hopefully will be getting a copy soon. I just discovered this
particular issue today, so I never filed a bug report.

You can download Visual Studio 2008 Express right now. If it's fixed, the
Express version should work as well as the retail version.

That said, crashing bugs in the Designer are uncommon and generally
involve very specific scenarios. Without customer input, they may not
have known to fix it. But you should at least try...it's possible someone
else found and reported the same issue and that it did get fixed.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top