Saturday, June 20, 2009

Editing XAML crashes the editor

Today I am playing with some personal stuff, just looking to improve my WPF skills. I found out this week that if you restyle a slider, you need to remember to put in the XAML for the areas you click outside the slider, to change your selection. However, I have a file with a styled slider, and because of the effect I want ( I have buttons in the background and I want to be able to click them ), I want to remove those areas from this particular style. EVERY time I open my XAML and delete the one that is below the slider, VS 2008 uses 13% of my processor ( always 13% ) and it locks up until I kill it. I am going to have to edit my XAML in notepad and then reopen the project.

And, that worked fine. The editor couldn't handle me removing some XAML ( as in, I select it, and remove it, the XML is valid before, and after the operation ) and it locks the editor every time. Remove the XAML in notepad, and reopen the project, it opens fine. So, my XAML was legible to the IDE before the operation, and also afterwards. I am assuming that some sort of control tree is maintained from the XAML to generate the preview, and that this somehow doesn't like having to deal with this ( invisible ) element being removed.

I believe Blend is less hostile to the idea of people hand editing XAML than it used to be ( the first versions I saw didn't even support searching in text, which was by design, because you were not supposed to use it if you wanted to edit code ). I am falling in love with Expression Design's ability to open an Adobe Illustrator file and let me export XAML. It often fails, but what it does is impressive enough that I am happy to fiddle with it to make it work. I still worry that the theory that Blend is what you use to create XAML, may be a reason that the tools in VS 2008 are still so poor, tho.

Update: This is the first project where I've used resources, I don't know if this is a factor, but I am finding more and more simple edits which kill the IDE and which therefore need to be done in notepad. How is this possible ? Surely the thing would be, if the control tree can't take the edit, just rebuild it. I am changing my resources file, so the IDE is not even rendering any sort of preview at the time.

1 comment:

  1. Have you taken a look at this: