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. Custom control resets font properties set through Xaml

Custom control resets font properties set through Xaml

Scheduled Pinned Locked Moved WPF
wpfdesigndebuggingquestion
2 Posts 2 Posters 0 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hello, I have a custom control, and in the Xaml declaration I set its FontFamily and FontSize properties to Consolas and 72 respectively. However, in the constructor, the FontFamily is Segoe UI and FontSize is 12 - and I haven't done any kind of editing of those properties other than the Xaml. Would could cause this? Thanks, Theo EDIT: I just tested something - if I set the FontFamily to be Consolas in the constructor, it still renders the text as if it were Segoe UI, and in the child TextView control, in its constructors, the debugger displays the control's FontFamily to be Segoe UI.

    P 1 Reply Last reply
    0
    • L Lost User

      Hello, I have a custom control, and in the Xaml declaration I set its FontFamily and FontSize properties to Consolas and 72 respectively. However, in the constructor, the FontFamily is Segoe UI and FontSize is 12 - and I haven't done any kind of editing of those properties other than the Xaml. Would could cause this? Thanks, Theo EDIT: I just tested something - if I set the FontFamily to be Consolas in the constructor, it still renders the text as if it were Segoe UI, and in the child TextView control, in its constructors, the debugger displays the control's FontFamily to be Segoe UI.

      P Offline
      P Offline
      PumbaPumba
      wrote on last edited by
      #2

      Could you please share some more details like code snippet of your constructor, OnApplyTemplate and the XAML block you are setting the font properties?

      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