Check this thread: How can I set up material light and dark mode in a MAUI or Blazor standalone app? - #7 by Igor