Pierre
Pierre

Reputation: 510

Material Design WPF, how to get the color to use it on border

Everything is in the title.

I'd like to get the color that I choose as primary in my ressources :

<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />

To use it on my border BorderBrush:

<Border BorderBrush="" BorderThickness="2,0,0,0" Padding="10" >

Thanks you

Upvotes: 3

Views: 15185

Answers (1)

mechanic
mechanic

Reputation: 781

It should be something like:

    <Border BorderBrush="{DynamicResource PrimaryHueMidBrush}" BorderThickness="2" Padding="10" Height="50" Width="300">
        <TextBlock Text="Material Design Test" />
    </Border>

You can replace PrimaryHueMidBrush with PrimaryHueLightBrush, or PrimaryHueDarkBrush.

You can find more info about configuring your App.xaml at MaterailDesign documentation

Upvotes: 10

Related Questions