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. Standard Button Layout

Standard Button Layout

Scheduled Pinned Locked Moved WPF
wpfcsharparchitecturetutorialquestion
6 Posts 3 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.
  • P Offline
    P Offline
    PaulPrice
    wrote on last edited by
    #1

    Again on with my quest to learn WPF controls and improve our standard controls library to make it easier to use within a MVVM environment. In this case I am looking for sggestions for how to best implemnt a standard button. I would like to create a standard button which has an image and caption. I understand that this is easily achieved using xaml, but ideally we would like a standard implementation so the button could be used in the following manor.

    <CustomControls:StandardButton ButtinImage="Logout.jpg" ButtonCaption="Button Text"/>

    How would you achieve this? 1. Inherit from the button class and add dependancy properties 2. Use Attached Properties and a style 3. Inherit fron UserControl using dependancy properties fro the image and caption Thanks for your time

    Just racking up the postings

    A P 2 Replies Last reply
    0
    • P PaulPrice

      Again on with my quest to learn WPF controls and improve our standard controls library to make it easier to use within a MVVM environment. In this case I am looking for sggestions for how to best implemnt a standard button. I would like to create a standard button which has an image and caption. I understand that this is easily achieved using xaml, but ideally we would like a standard implementation so the button could be used in the following manor.

      <CustomControls:StandardButton ButtinImage="Logout.jpg" ButtonCaption="Button Text"/>

      How would you achieve this? 1. Inherit from the button class and add dependancy properties 2. Use Attached Properties and a style 3. Inherit fron UserControl using dependancy properties fro the image and caption Thanks for your time

      Just racking up the postings

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      I would, personally, go for 1 or 2. 2 is good if you are clear on how to create attached properties.

      The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

      P 1 Reply Last reply
      0
      • P PaulPrice

        Again on with my quest to learn WPF controls and improve our standard controls library to make it easier to use within a MVVM environment. In this case I am looking for sggestions for how to best implemnt a standard button. I would like to create a standard button which has an image and caption. I understand that this is easily achieved using xaml, but ideally we would like a standard implementation so the button could be used in the following manor.

        <CustomControls:StandardButton ButtinImage="Logout.jpg" ButtonCaption="Button Text"/>

        How would you achieve this? 1. Inherit from the button class and add dependancy properties 2. Use Attached Properties and a style 3. Inherit fron UserControl using dependancy properties fro the image and caption Thanks for your time

        Just racking up the postings

        P Offline
        P Offline
        Pete OHanlon
        wrote on last edited by
        #3

        If you want to have a bit of fun, you could always create a Blend Behavior which set the Content of the button.

        I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        P 1 Reply Last reply
        0
        • P Pete OHanlon

          If you want to have a bit of fun, you could always create a Blend Behavior which set the Content of the button.

          I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

          Forgive your enemies - it messes with their heads

          My blog | My articles | MoXAML PowerToys | Onyx

          P Offline
          P Offline
          PaulPrice
          wrote on last edited by
          #4

          Not sure that sounds like fun...

          Just racking up the postings

          P 1 Reply Last reply
          0
          • A Abhinav S

            I would, personally, go for 1 or 2. 2 is good if you are clear on how to create attached properties.

            The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it. My latest tip/trick Visit the Hindi forum here.

            P Offline
            P Offline
            PaulPrice
            wrote on last edited by
            #5

            If i go for one, I am assuming that I can do away for a controltemplate and just set the content to be an image object and a label programitcally based on the dependancy properties. Does this sound right?

            Just racking up the postings

            1 Reply Last reply
            0
            • P PaulPrice

              Not sure that sounds like fun...

              Just racking up the postings

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              It does to me (and it's very easy to do).

              I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

              Forgive your enemies - it messes with their heads

              My blog | My articles | MoXAML PowerToys | Onyx

              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