Version

SetPropertyFromStyle Method

Extracts a property value from a Style and sets it on a DependencyObject
Syntax
'Declaration
 
Public Shared Function SetPropertyFromStyle( _
   ByVal target As DependencyObject, _
   ByVal targetProperty As DependencyProperty, _
   ByVal source As Style, _
   ByVal sourceProperty As DependencyProperty, _
   ByVal walkUpBasedOnChain As Boolean _
) As Boolean
public static bool SetPropertyFromStyle( 
   DependencyObject target,
   DependencyProperty targetProperty,
   Style source,
   DependencyProperty sourceProperty,
   bool walkUpBasedOnChain
)

Parameters

target
The target to receive the property setting
targetProperty
The property to set
source
The style that contains the setting
sourceProperty
The property to extract
walkUpBasedOnChain
True to search up the 'BasedOn' style chain.

Return Value

True if a value was found and set.
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also