Style Toolbar with MergedDictionaries

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 10 years ago by Jason Halbig
Version: 4.5.0486
Avatar
Hi All,
I was wondering if it was possible to utilized the themes in a resource dictionary.
I have a Resource Dictionary defined for a toolbar and would love to use the themes in this that would apply throughout the application. Any comments or suggestions.

Thanks!


<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Shared.xaml" />
</ResourceDictionary.MergedDictionaries>


<Style x:Key="ToolBarButtonBaseStyle" TargetType="{x:Type ButtonBase}">
<Setter Property="Height" Value="35"/>
<Setter Property="SnapsToDevicePixels" Value="true"/>
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Template">
<Setter.Value>........

Comments (4)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
You can merge the resource dictionaty into your Application.Resources collection. Is that what you mean?


Actipro Software Support

Posted 10 years ago by Jason Halbig
Avatar
Well I guess, what I was looking for was being able to utilize the Brush resources from a generic.xaml. So for instance I have a ControlTemplate and I want to use the ActiPro Brushes from the the Theme Browser to make my application have a consistent look and feel.
<ControlTemplate.Triggers>
   <Trigger Property="IsEnabled" Value="False">
      <Setter TargetName="Border" Property="Background" Value="{StaticResource DisabledBackgroundBrush}"/>
      <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource DisabledBackgroundBrush}"/>
      <Setter Property="Foreground" Value="{StaticResource DisabledForegroundBrush}"/>
   </Trigger>
</ControlTemplate.Triggers>
[Modified at 04/21/2009 11:23 AM]
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
If you use the Theme Browser, it lets you copy resource extensions to our Brush resources so that you can paste them in and use them in your application. So you could replace your "{StaticResource DisabledBackgroundBrush}" with one of our themed brushes using that method. Is that what you mean?

The documentation on Themes and the Theme Browser should have help on accomplishing this.


Actipro Software Support

Posted 10 years ago by Jason Halbig
Avatar
Thanks I figured it out, much easier than I thought.
Awsome stuff!
The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.