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.
Unfortunately, activation email could not send to your email. Please try again.

Extend the default styles applied by SkinStorage.VisualStyle

Thread ID:

Created:

Updated:

Platform:

Replies:

107349 Feb 25,2013 01:40 PM Aug 29,2013 01:33 AM WPF 3
loading
Tags: Tools
David Goedecke
Asked On February 25, 2013 01:40 PM

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>

 


Karuppasamy P [Syncfusion]
Replied On March 6, 2013 02:11 AM

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

David Goedecke
Replied On August 26, 2013 11:13 AM

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.

 


Karuppasamy P [Syncfusion]
Replied On August 29, 2013 01:33 AM

 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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;