none
Saving a Gradient as a Resource in Blend 3 RRS feed

  • Question

  • Previously, in Blend 1 & 2, I have created colour and gradient resources by clicking the button "Convert brush to resource", and saves it in a Resource Dictionary.

    In Blend 3, I have been able to create colour resources in my resource dictionary by clicking the little arrows next to the Hex Value of the colour "Convert colour to resource", but have not been able to figure out how to save a gradient into my resource dictionary.  When I try the same button, it only saves colour at one gradient stop.

    Is there a way to save my gradients into my resource dictionary in Blend 3?

     

    Thursday, May 6, 2010 6:44 PM

Answers

  • You could make a quick rectangle,

    select the background property,

    click the small rectangle next to the background in brushes pane,

    select Convert to new Resource

    assign name and place to save resource

     

    You can then access it from resource tab panel

    Is this what you are looking for?

    • Marked as answer by bellini1 Friday, May 7, 2010 2:21 PM
    Thursday, May 6, 2010 8:56 PM

All replies

  • You could make a quick rectangle,

    select the background property,

    click the small rectangle next to the background in brushes pane,

    select Convert to new Resource

    assign name and place to save resource

     

    You can then access it from resource tab panel

    Is this what you are looking for?

    • Marked as answer by bellini1 Friday, May 7, 2010 2:21 PM
    Thursday, May 6, 2010 8:56 PM
  • Hi Bellini,

    to save a gradientbrush as resource in a ResourceDictionary there is one additional step to go.

    1st, you must add a ResourceDictionary file to your project (File -> New Item -> Resource Dictionary -> [name it and press ok and build your project precautionary])

    2nd, in the "Create Brush Resource" dialog, that appears when you follow the instruction that devdmans posted, there is a section called "Define in". There you must select the radio button for "Resource Dictionary". If you do so, a combobox will be enabled, and in that combobox you can choose the ResourceDictionary (that you created before) where the resource should be saved.

    Hope this helps.

    B.t.w.: Before some time I wrote an article about organizing color themes using Merged resource dictionaries on my Blog. Maybe you are interested in that (although it is not specific to solve your problem).

    Regards,

    Martin

    Friday, May 7, 2010 12:27 PM
  • That works perfect - thank you.  This is perhaps also a better way to add the colours to the resource dictionary as well, than the way I had been using.
    Friday, May 7, 2010 2:40 PM
  • Thank you Martin.  I think your article could come in very handy in the future for me.

    Friday, May 7, 2010 2:42 PM