ScooterMcTooter / MoneyTracker

This is an application designed to visualize where your money is going and how much you are bringing in. The goal is to give the ability to plan for the future effectively by being able to immediately see the changes to the plan
1 stars 0 forks source link

#20 Dark mode toggle #32

Closed ScooterMcTooter closed 1 month ago

ScooterMcTooter commented 1 month ago

The most significant changes involve the implementation of a dark mode feature and the setup of the ApplicationDbContext with different SQLite databases for debug and release modes. The dark mode feature is implemented by adding new styles for Label, Button, and Entry elements in App.xaml, and setting the app theme based on the current user's app theme in App.xaml.cs. The ApplicationDbContext setup is done in the MauiProgram.cs file.

Here is a summary of the changes:

  1. The MauiProgram.cs file has been updated to include a new namespace MoneyTrackerMigrations. The AddDbContext method has been added to the builder.Services to set up the ApplicationDbContext with different SQLite databases for debug and release modes.

  2. New styles have been added for Label, Button, and Entry elements in App.xaml. These styles set the TextColor property based on the current app theme. Two new color resources TextLightMode and TextDarkMode have also been added.

  3. The App.xaml.cs file has been updated to set the app theme based on the current user's app theme. The MainPage is now set up with a SettingsViewModel instance retrieved from the DependencyService.

  4. In AppShell.xaml, the toolkit namespace has been added. The TextColor property of some elements has been updated to change based on the app theme. The Dark Mode and Enable Notifications labels and checkboxes have been replaced with buttons. The Reset Password button's font size has been reduced.

  5. The AppShell.xaml.cs file has been updated to use a SettingsViewModel instance as the BindingContext. The constructor now takes a SettingsViewModel instance as a parameter.

  6. The HomeViewModel.cs file now includes the MoneyTrackerMigrations namespace.

  7. The SettingsViewModel.cs file has been updated to include the Microsoft.Maui.ApplicationModel and System.Windows.Input namespaces. The isDarkMode and theme properties have been updated to reflect the current app theme. A new SetAppTheme command has been added to toggle the app theme.