Ticket T899545
Visible to All Users

How to catch the moment when a skin or palette is changed

created 5 years ago (modified 5 years ago)

[DevExpress Support Team: CLONED FROM Q355054: Skin change event]

Hi Ted. in 20.1 this mechanism is now obsolete.
What is the correct way to catch skin change events in 20.1?

Would it be too much trouble to demonstrate how to read both the type (basic, bezier, office etc…) and colour (blue dark, pine light etc…) within this event?

I managed to get this working to return the type and colour, however there is no colour/pallette name the first time the skin is changed for each type:

Visual Basic
AddHandler DevExpress.LookAndFeel.UserLookAndFeel.Default.StyleChanged, AddressOf MyStyleChanged ... Private Sub MyStyleChanged(sender As Object, e As EventArgs) Dim sTypeName As String = TypeName(sender) Dim lookAndFeel As DevExpress.LookAndFeel.UserLookAndFeel = CType(sender, DevExpress.LookAndFeel.UserLookAndFeel) Dim stronglyTypedArgument As DevExpress.LookAndFeel.LookAndFeelChangedEventArgs = CType(e, DevExpress.LookAndFeel.LookAndFeelChangedEventArgs) Trace.WriteLine("MyStyleChanged: " & stronglyTypedArgument.Reason.ToString & ", " & lookAndFeel.SkinName & ", " & lookAndFeel.ActiveSvgPaletteName) End Sub

Could you please show me how to get the lookAndFeel.ActiveSvgPaletteName when the style is changed the first time?

Kind Regards, Garry.

Answers approved by DevExpress Support

created 5 years ago

Hi,

The solution with the UserLookAndFeel.Default.StyleChanged event is still relevant. Your code is correct. It does not return an active palette name since a default palette does not have a name. You can check this by switching from the default palette to another one and vice versa.

If this information is not helpful, would you please describe your real scenario in greater detail?

    Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

    Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.