WPF: How to Template, Style, and Animate a WPF Button Control



Source code: http://sdrv.ms/1eqrx2U

In this video I show you how to start your own theme library by demonstrating how to re-template and re-style a WPF button control, animations included, so you can begin to learn how to develop your own WPF application theme library.

source

Fahad Hameed

Fahad Hashmi is one of the known Software Engineer and blogger likes to blog about design resources. He is passionate about collecting the awe-inspiring design tools, to help designers.He blogs only for Designers & Photographers.

37 thoughts on “WPF: How to Template, Style, and Animate a WPF Button Control

  • January 12, 2018 at 7:30 pm
    Permalink

    what if we just want to change hover color and need all other things default ? we just use hover code or all things change with it ?

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    This is tutorial about thinkig in xaml, not about buttons only. Very helpful material. Thank you a lot.

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Where do you know all the attributes and logic of how to create an elementary button. This is madness, how long does it take to create the entire information system?

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    loved the video could you make a video showing how to draw an arrow on a button

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    can anyone tell me cz m a beginner coder in wpf,how iz it possible to keep the window same but if next button is clicked the value in the label gets changed everytime,kindly help

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Got stuck at 03:52 – this line '<ResourceDictionary Source="WPFThemeDemo.Windows.Theme; component/Theme.xaml" />' gives 'An error occurred while finding the resource dictionary' error message. I have added Reference. And '.Properties' at the end of 'xmlns:local="clr-namespace:WPFThemeDemo.Windows.Theme.Properties">'. No luck. Stuck at the very beginning. Arghhhh. LOL.

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    10 minutes in I wanted to shoot myself. Your rattling keyboard is horrible for trying to concentrate. Its not professional.

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Hello. My App.xaml gives me an error. Please help. <ResourceDictionary Source="WPFThemeDemo.Windows.Theme;component/Theme.xaml"/> This gives me error "An error occured while finding the resource dictionary" And yes, I have added the reference to that file. It doesn't even give me that blue underline and it builds just fine but when I try to run, the line gives an exception. I'm using Visual Studio Community 2015.

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Also, I don't know if you're repsonding to comments but when ever I move the button, the button and the text disappears. Why is it doing that? I did exactly like in the video.

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Very very nice tutorial! You definitely deserve every view you've got.

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Very Nice.
    Is it possible to group buttons and by pressing them alternately, just one Button is focused?

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Nice tut thanx.. Should have moved the mic off your desk though…

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    This what I am getting when I try to start the program like you at 19:00 -> "A project with an Output Type Class Library cannot be started directly."

    Couldnt find my error after 20 minutes, still looking.

    Edit: I found my error, you have to set your program as a start up project. read here of you have the same problem: https://stackoverflow.com/questions/14506185/a-project-with-an-output-type-of-class-library-cannot-be-started-directly

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    you are adding A Reference in the Middle of the Video. what is That?

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    30:14 You changed from <Setter> to <Trigger.[Actions]> that does not work correctly: OnMouseOver it still perform corresponding animation while its supposed to not. Checked my code several times, its identical to yours. Did you changed anything else when You stopped recording? Or it is .NET version difference makes it so (Your is 4.5.1, mine 3.0)?

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Thanks! Very smart code, I learn more than make a theme seeing your video. New Subscriber!

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    This is very nice, but what if I want only some buttons to have this template and others another template?

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Great video, I hope you will do more videos just like this one! good job, have a thumbs up and a new subscriber.

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    When I move the Button is Invisible, isn't Invisible when is in the Center

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Hey there, I have only skipped through your video but judging from what I have seem Is WPF styling similar to CSS+HTML+Javascript right? especially since it does use XAML… I have worked with these latest before and have some styling experience, should I expect something somewhat similar with WPF?

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Thanks so much for this tutorial! Right now I'm having a problem I don't understand, though. I've been following along, typing the code exactly as you do, but the ControlTemplate gives an error "Object reference not set to an instance of an object." Do you know what might have caused that?

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    Thank you for the video.  Very helpful for us folks under the gun to get something up and working quickly with WPF!

    Reply
  • January 12, 2018 at 7:30 pm
    Permalink

    I would love to see the combo box control next! Awesome videos thanks for making them

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *