Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
165
A couple questions
posted

Hi,

I'm excited about your WPF product offerings and I think you bring a lot to the table in terms of price vs. offerings. Having said that, I'd like to ask a couple questions concerning the product. If I am wrong about something please feel free to correct me as I am not an expert yet.

 I'm evaluating your WPF Suite and a competitor of yours who offers a Ribbon and Dock. One thing I appreciate about the other offering is the ability to use the Button controls anywhere in the applcation, no strings attached. It just works.

Also, all the colors and brushes are accessible in a ComponentResourceKey, so they are easy to implement and reflect the current theme of the Ribbon. This ensures the standard windows controls and various UI elements stay in tune with the Docks and Ribbons.

Am I wrong about accessing the Brush values from a ComponetResourceKey and having those colors match the current theme? Is there a way to use a Button outside of the Ribbon without jumping through various hoops to make it behave as expected?

 

Thanks,

Chris Prindle

Parents
No Data
Reply
  • 54937
    Verified Answer
    Offline posted

    ComponentResourceKey is just a public derived ResourceKey class that may be used to identify resources. We use our own derived ResourceKey class that we expose instances of from our RibbonBrushKeys class. The resource key doesn't play any part in what the current theme is - it is just used by the wpf resource infrastructure when walking up the resource chain to locate a resource. So if an element has a background property set to a dynamic reference to a resourcekey, the wpf framework goes up that element's resource chain (i.e. its visual/logical tree, the application's resources and finally the resources of the assembly associated with the resource key). Using a ResourceKey doesn't necessarily keep things like the Ribbon and Dock in sync. That being said, you can put the resources (Office2kBlue, Office2kBlack, etc) into the application's Resources and therefore elements will pick up the value that is associated with that resourcekey (which would likely be a different brush).

    With regards to using the elements outside the Ribbon, it wasn't the intended goal so the elements have not been tested in that fashion. In the case of our ButtonTool, its default template uses our RibbonButtonChrome class. This class renders the background/border of the button based on the location. The location is based upon an inherited property that the various ribbon area set - e.g. ribbon (for the ribbongroup), application footer toolbar, etc. Currently, that chrome element does not render anything when used outside the ribbon (i.e. when the location property is not set). This is easily changed and you can submit an issue for it but many other elements are not designed to be used outside the ribbon. You may want to submit a suggestion for supporting using other ribbon elements outside the ribbon. If you do submit a suggestion please indicate which elements you are trying to use.

Children