Skip to main content

Microsoft Silverlight

Answered Question Blend 2.5: Editing Generic.xamlRSS Feed

(0)

IanA
IanA

Member

Member

249 points

50 Posts

Blend 2.5: Editing Generic.xaml

I have a control library in its own class library project. Most of my controls inherit from Control and use styles within Generic.xaml to set the control templates and states etc.

When I load my project in Blend 2.5 it does appear to be somewhat aware of Generic.xaml and will let me edit the control templates. However, as most of the templates have VSM states, Blend refuses to let me edit them (they display in the "States" editor but are all greyed out). I also noticed that when a template within Generic.xaml is edited Blend inserts VSM namespace declarations throughout the entire file (in Blend this will build ok and run), but once back in Visual Studio in debug mode I get a parser error on run.

I realise Blend is still beta, and the pace of change is fast. Can I assume that in the future Blend will be able to handle this better, as at present I have to build my style / template / states as regular resources using Blend in a dummy project, and then copy & paste them into Generic.xaml in my library?

Not a "show stopper" by any means, but it can be a bit of a pain if you want to go back and tweak things (i.e. copy template back into a dummy project resource, edit then copy back). Or, perhaps I'm missing something somewhere?

Yi-Lun Luo - MSFT
Yi-Lun L...

All-Star

All-Star

25052 points

2,747 Posts

Answered Question

Re: Blend 2.5: Editing Generic.xaml

Hello, this is a limitation of Expression Blend 2.5 June Preview. This is something that we're going to enable in a future build. But sorry I can't tell you any details at this time...

shanaolanxing - I'll transfer to the Windows Azure team, and will have limited time to participate in the Silverlight forum. Apologize if I don't answer your questions in time.

IanA
IanA

Member

Member

249 points

50 Posts

Re: Blend 2.5: Editing Generic.xaml

OK, thanks for that. It will improve productivity when its implemented.

unnir
unnir

Member

Member

60 points

20 Posts

Re: Blend 2.5: Editing Generic.xaml

Blend 2 Sp1 now allows you to edit copies of custom control templates, provided Generic.xaml has been authored per recommendation.

Thanks,
Unni

ckchouk
ckchouk

Member

Member

4 points

2 Posts

Re: Blend 2.5: Editing Generic.xaml

I have added states to my UserControl in a wpf project using blend 2 with sp1. Everything was working fine and then all of a suddin the states disappeared from the State browser in the design view. All the states are still in the xaml and all still work fine. I am tryin to change and add new states but could not get it to work.

seeligd
seeligd

Member

Member

7 points

13 Posts

Re: Blend 2.5: Editing Generic.xaml

Regarding generic.xaml - I have also found that if one has a simple project and authors the generic.xaml by hand, one can edit it to a degree with expression blend, but in my case, I have a solution split into multiple projects, some of which have their own generic.xaml files (each within .../themes).

When trying to edit one of these generic.xaml files in blend, I get the following error:

The root type was not expected. The following type was expected: "Application".

The beginning of the file looks like this:

<!-- COMPONENTS generic.xaml -->
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d"
...

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities