Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. CustomControl Styling Question

CustomControl Styling Question

Scheduled Pinned Locked Moved WPF
questiondotnetwpfcom
2 Posts 2 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kevin Marois
    wrote on last edited by
    #1

    I created this dummy control to ask the question... It's a TextBox with 2 buttons. If I wanted to give this control in an assembly to another developer, how would they modify the style to fit their needs? You can see I have named my brushes with some care, but what about changing triggers or maybe animations and other things? If this is all inside an assembly, how does the developer know how the style works what the style does? Generica.xaml

    <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:MyControl">

    <SolidColorBrush x:Key="Button.Normal.Foreground" Color="SteelBlue"/>
    <SolidColorBrush x:Key="Button.Normal.Background" Color="BlanchedAlmond"/>
    <SolidColorBrush x:Key="Button.Normal.Border" Color="DarkGray"/>
    <SolidColorBrush x:Key="Button.Hover.Background" Color="Orange"/>
    <SolidColorBrush x:Key="Button.Hover.Border" Color="#FF3C7FB1"/>
    <SolidColorBrush x:Key="Button.Pressed.Foreground" Color="Salmon"/>
    <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FF737B7F"/>
    <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
    <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="DarkGray"/>
    <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
    
    <SolidColorBrush x:Key="TextBlock.Normal.Foreground" Color="SteelBlue"/>
    <SolidColorBrush x:Key="TextBlock.Normal.Background" Color="BlanchedAlmond"/>
    <SolidColorBrush x:Key="TextBlock.Normal.Border" Color="DarkGray"/>
    <SolidColorBrush x:Key="TextBlock.Hover.Background" Color="#FFBEE6FD"/>
    <SolidColorBrush x:Key="TextBlock.Hover.Foreground" Color="Blue"/>
    <SolidColorBrush x:Key="TextBlock.Hover.Border" Color="#FF3C7FB1"/>
    <SolidColorBrush x:Key="TextBlock.Pressed.Foreground" Color="Blue"/>
    <SolidColorBrush x:Key="TextBlock.Pressed.Background" Color="#FF737B7F"/>
    <SolidColorBrush x:Key="TextBlock.Pressed.Border" Color="#FF2C628B"/>
    <SolidColorBrush x:Key="TextBlock.Disabled.Foreground" Color="DarkGray"/>
    <SolidColorBrush x:Key="TextBlock.Disabled.Background" Color="#FFF4F4F4"/>
    
    <SolidColorBrush x:Key="TextBox.Normal.Foreground" Color="SteelBlue"/>
    <SolidColorBrush x:Key="TextBox.Normal.Background" Color="Wh
    
    P 1 Reply Last reply
    0
    • K Kevin Marois

      I created this dummy control to ask the question... It's a TextBox with 2 buttons. If I wanted to give this control in an assembly to another developer, how would they modify the style to fit their needs? You can see I have named my brushes with some care, but what about changing triggers or maybe animations and other things? If this is all inside an assembly, how does the developer know how the style works what the style does? Generica.xaml

      <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:MyControl">

      <SolidColorBrush x:Key="Button.Normal.Foreground" Color="SteelBlue"/>
      <SolidColorBrush x:Key="Button.Normal.Background" Color="BlanchedAlmond"/>
      <SolidColorBrush x:Key="Button.Normal.Border" Color="DarkGray"/>
      <SolidColorBrush x:Key="Button.Hover.Background" Color="Orange"/>
      <SolidColorBrush x:Key="Button.Hover.Border" Color="#FF3C7FB1"/>
      <SolidColorBrush x:Key="Button.Pressed.Foreground" Color="Salmon"/>
      <SolidColorBrush x:Key="Button.Pressed.Background" Color="#FF737B7F"/>
      <SolidColorBrush x:Key="Button.Pressed.Border" Color="#FF2C628B"/>
      <SolidColorBrush x:Key="Button.Disabled.Foreground" Color="DarkGray"/>
      <SolidColorBrush x:Key="Button.Disabled.Background" Color="#FFF4F4F4"/>
      
      <SolidColorBrush x:Key="TextBlock.Normal.Foreground" Color="SteelBlue"/>
      <SolidColorBrush x:Key="TextBlock.Normal.Background" Color="BlanchedAlmond"/>
      <SolidColorBrush x:Key="TextBlock.Normal.Border" Color="DarkGray"/>
      <SolidColorBrush x:Key="TextBlock.Hover.Background" Color="#FFBEE6FD"/>
      <SolidColorBrush x:Key="TextBlock.Hover.Foreground" Color="Blue"/>
      <SolidColorBrush x:Key="TextBlock.Hover.Border" Color="#FF3C7FB1"/>
      <SolidColorBrush x:Key="TextBlock.Pressed.Foreground" Color="Blue"/>
      <SolidColorBrush x:Key="TextBlock.Pressed.Background" Color="#FF737B7F"/>
      <SolidColorBrush x:Key="TextBlock.Pressed.Border" Color="#FF2C628B"/>
      <SolidColorBrush x:Key="TextBlock.Disabled.Foreground" Color="DarkGray"/>
      <SolidColorBrush x:Key="TextBlock.Disabled.Background" Color="#FFF4F4F4"/>
      
      <SolidColorBrush x:Key="TextBox.Normal.Foreground" Color="SteelBlue"/>
      <SolidColorBrush x:Key="TextBox.Normal.Background" Color="Wh
      
      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Well, the easiest way to let people know is if you document the styles just the way you have here. If people want to adjust the triggers and templates, they can see what is affected just by reading the documentation.

      Advanced TypeScript Programming Projects

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups