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. Style Question

Style Question

Scheduled Pinned Locked Moved WPF
questionhelp
3 Posts 2 Posters 16 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 have this in my theme file:

    <Style TargetType="TextBlock">

    <Setter Property="Foreground" Value="{DynamicResource textForegroundBrush}"/>
    <Setter Property="FontSize" Value="14"/>
    

    </Style>

    Now, in a window I want to add additional settings

    <Window.Resources>

    <Style x:Key="headerTextStyle" 
            TargetType="TextBox">
    
        <Setter Property="FontSize" Value="24"/>
    
    </Style>
    

    </Window.Resources>

    Since the theme's style does not have a key, how do I base the window's style off the sstyle in the theme?

    If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

    Richard DeemingR 1 Reply Last reply
    0
    • K Kevin Marois

      I have this in my theme file:

      <Style TargetType="TextBlock">

      <Setter Property="Foreground" Value="{DynamicResource textForegroundBrush}"/>
      <Setter Property="FontSize" Value="14"/>
      

      </Style>

      Now, in a window I want to add additional settings

      <Window.Resources>

      <Style x:Key="headerTextStyle" 
              TargetType="TextBox">
      
          <Setter Property="FontSize" Value="24"/>
      
      </Style>
      

      </Window.Resources>

      Since the theme's style does not have a key, how do I base the window's style off the sstyle in the theme?

      If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

      Richard DeemingR Offline
      Richard DeemingR Offline
      Richard Deeming
      wrote on last edited by
      #2

      Try:

      </pre>
      <div class="signature"><hr size="1" color="#63B4FF" noshade="">
      <span style="color: rgba(0, 88, 170, 1)">
      <cite>"These people looked deep within my soul and assigned me a number based on the order in which I joined."</cite>
      <b> - Homer</b>
      </span></div></x-turndown>

      "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

      K 1 Reply Last reply
      0
      • Richard DeemingR Richard Deeming

        Try:

        </pre>
        <div class="signature"><hr size="1" color="#63B4FF" noshade="">
        <span style="color: rgba(0, 88, 170, 1)">
        <cite>"These people looked deep within my soul and assigned me a number based on the order in which I joined."</cite>
        <b> - Homer</b>
        </span></div></x-turndown>

        K Offline
        K Offline
        Kevin Marois
        wrote on last edited by
        #3

        Thanks, that did it. I always thought using that would cause the child style to based off WPF's base style

        If it's not broken, fix it until it is. Everything makes sense in someone's mind. Ya can't fix stupid.

        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