Creating Reusable Controls - WPF TUTORIALS

Поделиться
HTML-код
  • Опубликовано: 12 июн 2024
  • Learn how to create and use custom, reusable controls. Creating reusable controls is critical for reducing duplication and simplifying XAML. It's also quite easy with UserControls!
    TIMESTAMPS:
    0:00 - Introduction
    0:20 - Demo Introduction
    2:24 - Why We Need Reusable Controls
    3:12 - Creating the Control
    4:05 - Dependency Properties
    6:51 - Routed Events
    9:55 - Removing Duplication
    11:05 - Content Dependency Properties
    14:11 - Simpler Reusable Control
    15:27 - "Custom" Controls vs. User Controls
    16:48 - Conclusion
    ROUTED EVENTS: • Routed Events - WPF CU...
    SOURCE CODE: github.com/SingletonSean/wpf-...
    OTHER LINKS:
    Become a Member: / @singletonsean
    Donations: www.paypal.com/biz/fund?id=UB...
  • НаукаНаука

Комментарии • 31

  • @BeholdTheLight23
    @BeholdTheLight23 2 года назад +13

    Your videos are like golden nuggets. I love them all, you always read my mind and come up with the problem I think of and in minutes the answer is right there. I just can't stress enough how useful your videos are...

    • @SingletonSean
      @SingletonSean  2 года назад +4

      Glad these tutorials are helpful Norbert, and thank you for the donation!

    • @BeholdTheLight23
      @BeholdTheLight23 2 года назад +2

      @@SingletonSean Very welcome, I love your work and you teach people the way it meant to be.

  • @gary6212
    @gary6212 4 месяца назад +1

    Finally someone that explains how to pass data into and out of custom user controls...

  • @alanrgo1
    @alanrgo1 9 месяцев назад

    Loved how you don’t just explain the problem of not using reusable components, but actually make the viewer go through the cumbersome process of changing code multiple times, so they can realize by themselves this is a problem.

  • @someone150
    @someone150 Год назад +4

    Dude, respect for excellent tutorials

  • @anonymousannoyingmouse
    @anonymousannoyingmouse 2 года назад +1

    plot twist he is still using the same application that ran successfully for one time
    joking aside, thanks a bunch for your high quality videos

  • @markinhosm1
    @markinhosm1 2 года назад +3

    Thank you so much for the videos, I started watching to do a job interview and now I'm working with WPF, all thanks to you man, keep up with the awesome work! I wish you all the best!

    • @SingletonSean
      @SingletonSean  2 года назад

      Glad this has all helped Marcos, best wishes at your job!

  • @yoshimitsupunk
    @yoshimitsupunk Год назад

    Thank-you for this video. Was able to create a custom text box with placeholder text. 🙏🏾

  • @8180634
    @8180634 Год назад

    This was excellent, thank you! Your pace works with my ADD too. ;)

  • @nandinik7816
    @nandinik7816 2 года назад +1

    Such an informative video. Thank you

  • @user-pu2zp2ke2l
    @user-pu2zp2ke2l 4 месяца назад

    Great thanks

  • @calin1996mh
    @calin1996mh Год назад

    Excellent video!

  • @KBhushan619
    @KBhushan619 2 года назад

    Very informative sean❤️

  • @sergeys5270
    @sergeys5270 Год назад

    very good wpf videos

  • @allianceokc5067
    @allianceokc5067 Год назад

    With the routed event the sender is the tier card and not the button itself. Is there a way to have the sender = the button?

  • @user-yp4wd7dr2h
    @user-yp4wd7dr2h 9 месяцев назад

    @SingletonSean
    Hello Sean! thanks for the videos.
    Can Custom Controls have their own view model for bussiness logic ?

  • @tanzib82
    @tanzib82 2 года назад +1

    Great video Sean. I have noticed that you are using code behind here. Will you still use the code behind if it was in a MVVM setup?

    • @SingletonSean
      @SingletonSean  2 года назад +5

      Thanks Tanzib! For the dependency properties in the TierCard, I would certainly use code-behind since there's really no MVVM alternative. Instead of the event handlers, I would probably add ICommand dependency properties on the TierCard for something like "JoinCommand". Then, I would have view models with commands to handle the join button clicks. Good question!

    • @tanzib82
      @tanzib82 2 года назад

      @@SingletonSean Great! thanks for clearing this out for me.

  • @vandev_929
    @vandev_929 2 года назад

    Thx.

  • @pierrebielen7143
    @pierrebielen7143 2 года назад +1

    Thanks for this video, but i'm a litle question, how implement a command in a user control.
    Before Thanks

    • @SingletonSean
      @SingletonSean  2 года назад

      Hey Pierre, good question! This video demonstrates commands in user controls, specifically for handling routed events with commands: ruclips.net/video/Cx6YE86XzYE/видео.html

  • @lerocher2182
    @lerocher2182 Год назад +1

    Hi Sir,
    wenn i add a control inside the Header it can’t take Name property. Do you know why?

    • @lerocher2182
      @lerocher2182 Год назад

      Like:
      If I add TextBlock inside
      Components:TierCard.Header
      I can’t give a Name to the TextBlock

  • @lerocher2182
    @lerocher2182 2 года назад

    Thank you Sir, Please how can i add TextChangedEvent to EventManager :)

    • @lerocher2182
      @lerocher2182 2 года назад

      I want to use a TextBox instead of a TextBlock and i dont know how to add TextChangedEvent to the EventManage. please can you help mir?

    • @lerocher2182
      @lerocher2182 2 года назад

      Ok. I did it !!!! :)

  • @erik6048
    @erik6048 4 месяца назад

    Sloooooooooow dooooooown

  • @wayahedia9989
    @wayahedia9989 Год назад

    Nice. Thank you.