We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Extend the default styles applied by SkinStorage.VisualStyle

I have applied a visual style through the static method SkinStorage.VisualStyle. For example Blend.

I override and inherit from the default style to supply tooltips for data validation errors on the textbox,

If I apply this to the forms resources, the skin storage style is removed - is there a way to do this?

<Window.Resources><Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}"><Style.Triggers><Trigger Property="Validation.HasError" Value="true"><Setter Property="ToolTip" Value="{Binding RelativeSource={x:Static RelativeSource.Self},Path=(Validation.Errors)[0].ErrorContent}"/></Trigger></Style.Triggers></Style>

</Window.Resources>

 


3 Replies

KP Karuppasamy P Syncfusion Team March 6, 2013 07:11 AM UTC

Hi David,
 
Sorry for the delay in getting back to you.
 
We have done a sample based on your requirement. Kindly download the sample from below link.
In the below sample, we have set the ToolTip to the TextBox as per your suggestion and used Blend VisualStyle. And we are unable to reproduce the issue. The VisualStyle is getting applied to the TextBox as desired.
 
Please refer the sample, and if this is not your scenario, kindly modify the sample so that issue reproduces.
 
Kindly let us know if you have any other queries.
 
Regards,
Karuppasamy P


style_1a1e6bf4.zip


DG David Goedecke August 26, 2013 03:13 PM UTC

The attached solution zip file is not available. And just to clarify here are all the steps to recreate my problem.
 
Define a visual style at the applicaiton level - for example using Blend like this
<Style TargetType="myProject:MyWindow"><Setter Property="sync:SkinStorage.VisualStyle" Value="Blend"></Style>
 
Then I define my style say for a Label Control
<Style TargetType="Label"><Setter Property="HorizontalContentAlignment" Value="Right"/></Style>
 
The style for labels is lost, until I remove the call VisualStyle.

 



KP Karuppasamy P Syncfusion Team August 29, 2013 05:33 AM UTC

 Hi David,

Sorry for the being caused.

We have done a simple sample, which can be downloaded from the below location.

In the sample we have added the ResourceDictionary, and added the BasedOn property to override the Syncfusion Themes.

CodeSnippet:

ResourceDictionary.MergedDictionaries>

                <ResourceDictionary Source="/Syncfusion.Shared.WPF;component/SkinManager/MetroStyle.xaml"/>

            </ResourceDictionary.MergedDictionaries>

 

<Style TargetType="Label" BasedOn="{StaticResource MetroLabelStyle}">

                <Setter Property="HorizontalContentAlignment" Value="Right"/>

                <Setter Property="Background" Value="Bisque"/>

            </Style>

 



Kindly revert back to us if this sample helps you.

Regards,
Karuppasamy P



StyleDemo_d2d453da.zip

Loader.
Live Chat Icon For mobile
Up arrow icon