User Controls Using Blend

I am creating a custom control for my Silverlight 2 application. It is in the same SL class project and contains two files:

  • Control-derived MyControl class with multiple DepedencyProperties
  • themes / generic.xaml, with visual elements (ControlTemplate), states for VSM and transitions

I created the whole xaml manually and it works, but you want to use Blend2 (SP1) for editing! When I open generic.xaml in Blend and switch to the Resources tab, I have nothing to change.
For example, when I put this visual definition of the template and states in App.xaml (my main SL project), I can access all the elements and states through the Resources and States tabs and visually edit them.

Does Blend even support editing support for generic.xaml from a SL2 class project?
What is the best practice for creating custom controls? I don’t want my user control to depend on anything from the main SL2 project, but I want them to be skins and be able to dynamically change skins (themes).

+4
source share
2 answers

You can edit this with Blend.

  • Open the management project in Blend.
  • Open your generic.xaml
  • go to the Resources tab
  • Expand generic.xaml
  • Double-click the style resource that you want to change.
  • In the Objects and Timeline section, right-click the style and select Modify Controls β†’ Modify Template

Now you can edit the template in the generic.xaml file. It looks like you are already following best practices with parts and conditions. If you want the best practices provided in the best, consider this detailed report on how to deal with development time extensibility . There you will learn how to make Visual Studio and Blend design elements for Silverlight.

+7
source

I recreated the whole project and suddenly I can edit my generic.xaml from resources. But I can’t add the news specified in Blend, because I have to go to xaml.

0
source

All Articles