I have moved to WPF. Incredible stuff! Anyway I have been playing with the Effects and was wondering if there was a way to have all controls of a certain type to inherit an Effect rather than add the effect node to each control in the XAML code. Rarely am I not able to research thing like this on my own. Thanks for any tips!
WPF effects inheritance.
Page 1 of 12 Replies - 3737 Views - Last Post: 07 September 2012 - 08:25 AM
Replies To: WPF effects inheritance.
#2
Re: WPF effects inheritance.
Posted 07 September 2012 - 06:50 AM
Yeah, that where you could create a style for a certain control type, and then apply that style to the controls that you want to look like that. Here is a tutorial:
http://wpftutorial.net/Styles.html
you just need to add the effect to this simple example. If you want to apply that style to every instance of that control automatically, take a look at this example:
http://stackoverflow...rols-wpf-styles
http://wpftutorial.net/Styles.html
you just need to add the effect to this simple example. If you want to apply that style to every instance of that control automatically, take a look at this example:
http://stackoverflow...rols-wpf-styles
#3
Re: WPF effects inheritance.
Posted 07 September 2012 - 08:25 AM
Exactly, I knew they would have a plan for that. Thanks!
Finished product!
Finished product!
<window.Resources>
<Style TargetType="TextBox" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect
Direction="315"
Color="Black"
RenderingBias="Quality"
ShadowDepth="3" />
</Setter.Value>
</Setter>
</Style>
</window.Resources>
This post has been edited by _HAWK_: 07 September 2012 - 08:50 AM
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|