Dynamic App Themes in Xamarin.Forms - Light, Dark, & Custom Modes

Поделиться
HTML-код
  • Опубликовано: 30 ноя 2024

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

  • @jomargonzalez9184
    @jomargonzalez9184 3 года назад

    16.00 perfect time to make use of enums!
    public enum Themes { Default, Light, Dark }

  • @saroshwadia
    @saroshwadia 3 года назад +3

    As usual another fab video - right on the money 5 thumbs up :-)

  • @alaaburayyan
    @alaaburayyan 3 года назад +1

    You get me! I was just looking for something to explain that to me.
    Thanks man.

  • @vukilesimelane2033
    @vukilesimelane2033 3 года назад

    Thank you so much James. Needed this soo much.

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

    omg, big ty James

  • @zx-xn1lb
    @zx-xn1lb 3 года назад +1

    Hey James,I followed your xamarin 101 doing my Android homework. I really apreciated you teach me so much which made me build a APP with poor C# knowledge.Although it was difficult at first, watching your video repeatedly and practicing by myself gave me a lot of gains.I will always support your video.
    In addition, I have a small request :Can you introduce sharpnado UI control in your video, which is the UI plug-in you put in your plug-in link. The code there is still a bit difficult for me, I think most people must also want to know how to make a beautiful interface.Thanks.

    • @zx-xn1lb
      @zx-xn1lb 3 года назад

      I've built backend for my music APP, but how to make beautiful UI is still a problem for me

    • @JamesMontemagno
      @JamesMontemagno  3 года назад

      Glad you got it going! That is awesome! Checkout this blog on app design devblogs.microsoft.com/xamarin/building-beautiful-apps-with-xamarin-forms/

    • @zx-xn1lb
      @zx-xn1lb 3 года назад

      @@JamesMontemagno Thanks for your help so fast.I believe this will definitely allow me to build a good-looking UI

  • @bashobbel3575
    @bashobbel3575 3 года назад

    Cool , thanks for the video . Going to use some of it.

  • @cprashanthreddy
    @cprashanthreddy 3 года назад

    Awesome, this is what I was looking for.. Thank you.

  • @hanh.trinh.yeu.thuong
    @hanh.trinh.yeu.thuong 3 года назад

    Thank so much, James!

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

    James hi, first I'd like to thank you so much for all the great videos and knowledge you release to the community , helping us all in our development.
    In your examples you are using SHELL and talked about it in the videos how great it is.
    If at all possible I'd love to see how to do RTL on the shell "hamburger" menu. Changing the content of the menu (flyout) to RTL at runtime is not a problem - just apply "FlowDirection=RightToLeft" on the shell definition. However the "hamburger" always stays on the left. I tried using your approach and "piggybacked" on your Dynamic App Themes DI and "Forced RTL" which did the trick. However it had the unintentional results of staying RTL on all APPs even after I closed and removed the app from my phone.
    I should mention that I'm using an Android phone (Galaxy S10) and do not know what it looks like on an iPhone.
    Thanks again,
    Shlomi

  • @paul790905
    @paul790905 3 года назад

    James, Thanks

  • @LeeM0to
    @LeeM0to 3 года назад

    Another great useful video James, thanks 👍

  • @gmcclenny
    @gmcclenny 3 года назад +1

    If using an image/logo, can I show 1 version of the image if light mode is selected, and a different color image if dark mode is selected?

    • @JamesMontemagno
      @JamesMontemagno  3 года назад +1

      Same way, you can have 2 different images and use the AppThemeBinding

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

    Hi. If I background my app and change the OS to dark mode (Or Light Mode), when I come back to my app, the page is the same. If I change to a new page, it will change to the OS mode, but if I navigate back, the other page is still in the original mode.

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

    Hello, I followed your tutorial.
    But if I set the theme to Unspecified, when I load the application, it crashes saying that the binding should be done in a UI thread.
    If I force the theme to dark or light, it does not happen.
    I probably missed something, but I do not know what.

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

      Depending on when you are running it you may want to run it on the UIThread for changes perhaps... I would need to see a repo of it or take a look at my coffee app sample and see if that works for you.

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

    Genial settings interface at 13:51

  • @kylewang1571
    @kylewang1571 3 года назад +1

    If we want to add "AppThemeBinding" to status bar, how to achieve it? And how to set different status bar color for different page?

    • @JamesMontemagno
      @JamesMontemagno  3 года назад

      Great question! you can set it on Android via -> github.com/jamesmontemagno/Hanselman.Forms/blob/vnext/src/Android/Helpers/Environment.cs on iOS You set the navigation bar -> gist.github.com/jamesmontemagno/4fa47d55048e5791249653f63f3ac3cb and config info.plist like I put in this gist

    • @kylewang1571
      @kylewang1571 3 года назад

      @@JamesMontemagno Thank you so much, James.

  • @nick0taylor
    @nick0taylor 3 года назад

    How do I change the color of the text in my flyout items? Ive got everything racting to dark theme including the background color of the flyout but I cant seem to change the text color and what color the currently active tab has in hte flyout menu

    • @JamesMontemagno
      @JamesMontemagno  3 года назад

      You would want to adjust this in your Shell: github.com/jamesmontemagno/MyCoffeeApp/blob/master/MyCoffeeApp/MyCoffeeApp/AppShell.xaml#L39

  • @joeyireland21
    @joeyireland21 11 месяцев назад

    Hi James, I know this is an old video but when you do this on iOS it does not change the keyboard colours just stays in light mode.

    • @JamesMontemagno
      @JamesMontemagno  11 месяцев назад

      It is your apps theme, the keyboard works off the system and what is behind it.

  • @roman3dart78
    @roman3dart78 3 года назад

    How can I add the enum to get "AppThemeBinding=RedStyle".
    I need more themes to pick than light and dark..

    • @JamesMontemagno
      @JamesMontemagno  3 года назад +1

      Like I said in this case you would directly use DynamicResource for all of your colors and then set them in the code behind for each theme. You woul dnot use AppThemeBinding in this case. For example here docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/theming/theming

  • @santoshkundkar8914
    @santoshkundkar8914 3 года назад

    Awesome 👌

  • @dr.d303
    @dr.d303 2 года назад

    How do you stick always on top your emulator?

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

      There is a setting in the android emulator to be always on top

    • @dr.d303
      @dr.d303 2 года назад

      @@JamesMontemagno Thankyou James!

  • @saroshwadia
    @saroshwadia 3 года назад

    How come I don't see the Dynamic App Themes code in the repo?

    • @JamesMontemagno
      @JamesMontemagno  3 года назад +1

      Whoops, forgot to merge it in :) There now! github.com/jamesmontemagno/MyCoffeeApp/pull/6

    • @saroshwadia
      @saroshwadia 3 года назад

      @@JamesMontemagno Got it Thx :-)

  • @sandanuwan4441
    @sandanuwan4441 3 года назад

    Sri. How to upload image from phone gallery or camera without hard cording image. Can you show it form another lesson. If you can do it for CoffeeApp its would me great. Because of I already followed all lessons. Now I want to add coffee cup image from my gallery without using same image everytime. And also I want to use phone camera if not have phone in gallery. Can you please show it in next lesson. I am waiting for it. Thank you

    • @JamesMontemagno
      @JamesMontemagno  3 года назад

      For technical support -> docs.microsoft.com/en-us/answers/products/dotnet

  • @ehabghonem
    @ehabghonem 3 года назад

    can you help me to export sum data to pdf file and use it to share in WhatsApp

  • @williamprogramer4168
    @williamprogramer4168 3 года назад

    ⭐⭐⭐⭐⭐