lundi 23 juillet 2012 16:29
I just updated my copy of Visual Studio 2012 with the July 2012 update and now the designer is crashing when I try to edit the ControlTemplate of a custom derived control I created. The Designer was not crashing prior to the July 2012 update.
Here's what I have to reproduce this:
- Start a Blank Metro project in VS 2012 with July 2012 Update
- Add a new item, a TemplatedControl
- Derive your new TemplatedControl from something other than Control. In my case I used TextBox
- Create a copy of the TextBox template and put it in Generic.xaml
- Change the TextBox template to target your new template custom control you added
- Use your custom control on a Page and then try to edit the current template of the control
I have a sample project uploaded to my Skydrive that demonstrates the problem:
If I put the ControlTemplate in the Resources of the same page I use the control on, it works, I can edit the template. This is not acceptable because I'll have to duplicate this template on every page where I want to use it.
How can I get this to work the way it used to work?
Toutes les réponses
mardi 24 juillet 2012 16:24Modérateur
I downloaded your repro scenario and edited generic.xaml and customcontrol1.cs, selected mainpage.xaml. Are there additional steps for us to get it to repro?
mardi 24 juillet 2012 17:07
- Open the project
- Build the solution
- Open Generic.xaml
- Switch to Design View for Generic.xaml. Once the Designer loads, it will say "Generic.xaml cannot be edited in the Design View."
- Open MainPage.xaml
- In the Document Outline window (Ctrl+Alt+T or View...Other Windows...Document Outline), click the CustomControl1 node
- Right-click, select Edit Template -> Edit Current
- Visual Studio switches to Generic.xaml, which was already opened and in Design View, and in my case the Designer crashes and displays this:
mardi 24 juillet 2012 17:42
Thanks for reporting this issue. We can repro this on RC, but it looks to be fixed in our latest internal bits. You should be getting this fix in the RTM version of Visual Studio 2012.