CUSTOMIZING XAML SKINS FOR POWERBUILDER.NET WPF
APPLICATIONS
DAVE FISH, ENGINEERING EVANGELIST
2 – Company Confidential – April 18, 2023
AGENDA
• Overview of Styles, Templates, Skins and Themes
• Using Skins in PowerBuilder .NET Applications
• Skins for Applications, Windows, and Controls
• Skins for DataWindows
• Customizing Skins
3 – Company Confidential – April 18, 2023
TERMINOLOGY
• Styles:• A simple mechanism for separating property values from
user interface elements. The foundation for templates and skins
• Templates• Powerful objects used to restyle controls in WPF
• Skins• Application-specific collections of styles and/or
templates, typically with the ability to be replaced dynamically
4 – Company Confidential – April 18, 2023
STYLES
• Main function is to group together property values that could otherwise be set individually
• This group of values can be shared among multiple elements• Serves a similar purpose to inheritance but can be much more
powerful• Styles can be shared among different kinds of elements
(button, listbox, toolbar, tab control, etc.)• Can be restricted to particular types of controls• Can contain Triggers
• Property Triggers• Data Triggers• Event Triggers
STYLES DEMONSTRATION
6 – Company Confidential – April 18, 2023
TEMPLATES
• Collection of Styles
• WPF supports multiple types of templates• Control Templates• ItemsPanel Templates• Data Templates
• Control templates are used with styles to create Skins
TEMPLATES DEMONSTRATION
8 – Company Confidential – April 18, 2023
SKINS
• Not a distinct concept in WPF
• Use Dynamic Resources combined with Styles and Templates to create dynamic skinning
9 – Company Confidential – April 18, 2023
SKINS IN POWERBUILDER .NET
• PowerBuilder .NET has enhanced WPF to make applying skins easy
• Skins can be applied at the:• Application level (application object property)• Window level (Window property)• Control level (control property)
• Skins can be applied at design time or at runtime• PowerBuilder .NET includes 5 built-in skins• You can customize these skins or create your own
10 – Company Confidential – April 18, 2023
POWERBUILDER SKINS
• Theme Skins:• Classic (Generic) (Windows 2000 Look and Feel)• Luna (Windows XP Look and Feel)• Aero (Windows Vista and Windows 7 Look and Feel)
• Pre-defined Skins:• Expression Dark• Metal• Rainer Orange• Rough Green• Shiny Dark Teal
11 – Company Confidential – April 18, 2023
POWERBUILDER SKINS
• Theme Skins:• Embedded in Sybase.PowerBuilder.WPF.Controls
• Pre-defined Skins:• Embedded in Sybase.PowerBuilder.WPF.Controls.Skins
• If you don’t select a skin, the theme skin for your operating system will be used
12 – Company Confidential – April 18, 2023
DATAWINDOW SKINS
• The DataWindow Control also contains a Skin property
• Custom skin XAML files can be applied to the Preview Window in the DataWindow painter
SKINS DEMONSTRATION
14 – Company Confidential – April 18, 2023
CUSTOMIZING SKINS
• PowerBuilder skins can be customized
• The easiest way to do this is to take an existing PowerBuilder skin and modify it
• In-depth knowledge of WPF Styles and Templates helpful
• PowerBuilder 12.5 will make customization easier through an IDE feature called VisualStateManager
SKIN CUSTOMIZATION DEMONSTRATION