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. Timer

Timer

Scheduled Pinned Locked Moved WPF
csharpwpftutorialquestion
5 Posts 4 Posters 1 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
    pix_programmer
    wrote on last edited by
    #1

    Hi! I'm new to WPF. I want to add a button(initially invisible) and every minute I've to make it visible. How to do this?

    M A 2 Replies Last reply
    0
    • P pix_programmer

      Hi! I'm new to WPF. I want to add a button(initially invisible) and every minute I've to make it visible. How to do this?

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      Add a button set it's visibility to a property in your VM/code behind add a timer to your vm that toggles the property start the timer when you load the view

      Never underestimate the power of human stupidity RAH

      P 1 Reply Last reply
      0
      • M Mycroft Holmes

        Add a button set it's visibility to a property in your VM/code behind add a timer to your vm that toggles the property start the timer when you load the view

        Never underestimate the power of human stupidity RAH

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

        Or use the entirely XAML way and use a Storyboard.

        *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

        "Mind bleach! Send me mind bleach!" - Nagy Vilmos

        My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

        M 1 Reply Last reply
        0
        • P Pete OHanlon

          Or use the entirely XAML way and use a Storyboard.

          *pre-emptive celebratory nipple tassle jiggle* - Sean Ewington

          "Mind bleach! Send me mind bleach!" - Nagy Vilmos

          My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Pete O'Hanlon wrote:

          use a Storyboard

          Advanced xaml work, I have not started working with more than the basics in xaml so a storyboard did not occur to me. I can see myself going through these apps in a couple of years and shaking the head in despair.

          Never underestimate the power of human stupidity RAH

          1 Reply Last reply
          0
          • P pix_programmer

            Hi! I'm new to WPF. I want to add a button(initially invisible) and every minute I've to make it visible. How to do this?

            A Offline
            A Offline
            Andy411
            wrote on last edited by
            #5

            Instead of changing the visibility you could control the button's oppacity. Something like:

            DoubleAnimation animation = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromMilliseconds(1400)));

            yourButton.BeginAnimation(Load.OpacityProperty, animation);

            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