How to Switch Themes in a WPF App at Runtime

Поділитися
Вставка
  • Опубліковано 5 гру 2024

КОМЕНТАРІ • 24

  • @C_ThreadedBackGWorker
    @C_ThreadedBackGWorker 8 місяців тому

    Thank you for this Video. this would have to be the most professionally explained WPF theme tutorial I have seen to date. Well explained and Included source code project. You are enjoyable to watch, listen to and Learn from.

  • @rolandwatz7797
    @rolandwatz7797 Рік тому +1

    Mate it's so good to watch you. Lots of these Videos are boring like hell, becuase U have to watch the guys preparing the UI with mistyping 1000 times. But this video is just amizing good, with well prepared content and easy explanation. You are a talented teacher Sir. Well done.

  • @liamlluls1588
    @liamlluls1588 Рік тому +2

    Nice, good idea for part 2, store the user choice in settings.settings or something so they don’t have to change it to dark every time they boot the app

  • @Freddys_Ventures
    @Freddys_Ventures 2 місяці тому

    Love your video I was crashing and burning until I found your example!

  • @NAngelGr
    @NAngelGr Рік тому

    You are a star!! Very helpfull approach!! Thanx for the tutorial!!

  • @ThomasSchmidt-Esterle
    @ThomasSchmidt-Esterle Рік тому

    Very clean and straight forward. **ThumbsUp**

  • @solvedplus858
    @solvedplus858 2 місяці тому

    very good tutorial
    Many thanks

  • @AmirRobo
    @AmirRobo 3 місяці тому

    This is what I need. tnx

  • @fredwbd95
    @fredwbd95 3 місяці тому

    I'm glad I found your videos; I'm a long time programmer, but I've been doing such varied work that I don't get the chance to focus on things like this. I have a question, though, if I want to create a user control library, it seems like the technique of using DynamicResource doesn't work - I have no way to specify a resource file. I could just write the library, I suppose, as a wpf application instead of a library (I can still easily link to the DLL), but I don't think that's really a great approach.

  • @omostan
    @omostan 7 місяців тому

    I have to agree with what @ThomasSchmidt-Esterle wrote: very clear and straightforward. Many thanks for the simple yet concise explanation.

  • @MrBiohazard542
    @MrBiohazard542 Рік тому +1

    will the "theme change" on the main window also be applied throughout the operation of the application such as a user being re-directed to a new window? or this color change is only applied to one certain window?

    • @TacticDevs
      @TacticDevs  Рік тому +1

      The theme will apply to the entire application because the resource dictionary resource is available through the app class which makes it available in all the windows

  • @bartsworkshop
    @bartsworkshop Рік тому

    Well done easy to follow thank you.

  • @aleksi6012
    @aleksi6012 9 місяців тому

    Good stuff, thanks a lot!

  • @ihsannuruliman4005
    @ihsannuruliman4005 Рік тому

    this is really nice. thank you

  • @Racso_
    @Racso_ Рік тому +1

    Thank you!

  • @grouchograyson498
    @grouchograyson498 Рік тому

    Thankyou brother.

  • @hel2x
    @hel2x Рік тому

    How do I can use it with color animations?

  • @mikefocal5770
    @mikefocal5770 Рік тому +1

    very interesting

  • @tombobadil2331
    @tombobadil2331 Рік тому

    Don't you need to clear the MergedDictionaries as well, before adding every time?

    • @TacticDevs
      @TacticDevs  Рік тому

      We do not need to clear the dictionaries cause they contain the styling and they are defined as resources. We only need to switch between light and dark

  • @Azimof161
    @Azimof161 Рік тому

    Could you add a x:Name and only change the source property Source? Or is there something that I missed?

    • @Azimof161
      @Azimof161 Рік тому

      Would this work for you in this instance?
      ResourceDictionary Theme = new ResourceDictionary() {Source="URI"};
      App.Current.Resources.Remove("Dark");
      App.Current.Resources.Add("Light", Theme);
      Because I want to work with a lot of merge dictionaries, and I don't want to lose that ability

    • @TacticDevs
      @TacticDevs  Рік тому

      Unfortunately you can’t add a key to the resource dictionary itself but only to its contents