diff --git a/FinTrack/App.xaml.cs b/FinTrack/App.xaml.cs index efe33eb..b9107df 100644 --- a/FinTrack/App.xaml.cs +++ b/FinTrack/App.xaml.cs @@ -60,7 +60,14 @@ private void ConfigureServices(IServiceCollection services) services.AddTransient(); services.AddTransient(); services.AddTransient(); + + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); services.AddTransient(); diff --git a/FinTrack/Enums/AppearanceType.cs b/FinTrack/Enums/AppearanceType.cs new file mode 100644 index 0000000..42a2505 --- /dev/null +++ b/FinTrack/Enums/AppearanceType.cs @@ -0,0 +1,16 @@ +using System.ComponentModel; + +namespace FinTrack.Enums +{ + public enum AppearanceType + { + [Description("Light Mode")] + Light, + + [Description("Dark Mode")] + Dark, + + [Description("System Default")] + SystemDefault + } +} diff --git a/FinTrack/Enums/BaseCurrencyType.cs b/FinTrack/Enums/BaseCurrencyType.cs new file mode 100644 index 0000000..2190ef7 --- /dev/null +++ b/FinTrack/Enums/BaseCurrencyType.cs @@ -0,0 +1,31 @@ +using System.ComponentModel; + +namespace FinTrack.Enums +{ + public enum BaseCurrencyType + { + [Description("TRY - Turkish Lira")] + TRY, + + [Description("USD - United States Dollar")] + USD, + + [Description("EUR - Euro")] + EUR, + + [Description("GBP - British Pound")] + GBP, + + [Description("JPY - Japanese Yen")] + JPY, + + [Description("AUD - Australian Dollar")] + AUD, + + [Description("CAD - Canadian Dollar")] + CAD, + + [Description("CHF - Swiss Franc")] + CHF + } +} diff --git a/FinTrack/Enums/NotificationSettingsType.cs b/FinTrack/Enums/NotificationSettingsType.cs new file mode 100644 index 0000000..72f8842 --- /dev/null +++ b/FinTrack/Enums/NotificationSettingsType.cs @@ -0,0 +1,19 @@ +using System.ComponentModel; + +namespace FinTrack.Enums +{ + public enum NotificationSettingsType + { + [Description("Spending limit warning")] + SpendingLimitWarning, + + [Description("Expected bill reminder")] + ExpectedBillReminder, + + [Description("Weekly spending summary")] + WeeklySpendingSummary, + + [Description("New features and announcements")] + NewFeaturesAndAnnouncements + } +} diff --git a/FinTrack/Models/Settings/NotificationSettingItemModel.cs b/FinTrack/Models/Settings/NotificationSettingItemModel.cs new file mode 100644 index 0000000..4e8dc56 --- /dev/null +++ b/FinTrack/Models/Settings/NotificationSettingItemModel.cs @@ -0,0 +1,19 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using FinTrack.Enums; + +namespace FinTrack.Models.Settings +{ + public partial class NotificationSettingItemModel : ObservableObject + { + public NotificationSettingsType SettingType { get; set; } + + [ObservableProperty] + private bool isEnabled; + + public NotificationSettingItemModel(NotificationSettingsType settingType, bool isEnabled) + { + SettingType = settingType; + this.isEnabled = isEnabled; + } + } +} diff --git a/FinTrack/Styles/ModernStyles.xaml b/FinTrack/Styles/ModernStyles.xaml index bee571b..e95c191 100644 --- a/FinTrack/Styles/ModernStyles.xaml +++ b/FinTrack/Styles/ModernStyles.xaml @@ -665,7 +665,6 @@ - + + \ No newline at end of file diff --git a/FinTrack/ViewModels/AppSettingsContentViewModel.cs b/FinTrack/ViewModels/AppSettingsContentViewModel.cs new file mode 100644 index 0000000..5859837 --- /dev/null +++ b/FinTrack/ViewModels/AppSettingsContentViewModel.cs @@ -0,0 +1,55 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using FinTrack.Enums; +using Microsoft.Extensions.Logging; +using System.Collections.ObjectModel; +using System.Windows; + +namespace FinTrack.ViewModels +{ + public partial class AppSettingsContentViewModel : ObservableObject + { + public ObservableCollection AppearanceTypes { get; } + + public ObservableCollection CurrencyTypes { get; } + + [ObservableProperty] + private bool isFirstOpening = true; + + private readonly ILogger _logger; + + public AppSettingsContentViewModel(ILogger logger) + { + _logger = logger; + AppearanceTypes = new ObservableCollection(); + CurrencyTypes = new ObservableCollection(); + + InitializeAppearanceTypes(); + } + + private void InitializeAppearanceTypes() + { + AppearanceTypes.Clear(); + foreach (AppearanceType appearanceType in Enum.GetValues(typeof(AppearanceType))) + { + AppearanceTypes.Add(appearanceType); + } + + CurrencyTypes.Clear(); + foreach (BaseCurrencyType currencyType in Enum.GetValues(typeof(BaseCurrencyType))) + { + CurrencyTypes.Add(currencyType); + } + } + + [RelayCommand] + private void AppSettingsContentChanges() + { + _logger.LogInformation("Kullanıcı uygulama ayarlarını değiştirdi. İlk açılış: {IsFirstOpening}", IsFirstOpening); + MessageBox.Show("Kullanıcı uygulama ayarlarını değiştirdi.", + "Uygulama Ayarları", + MessageBoxButton.OK, + MessageBoxImage.Information); + } + } +} \ No newline at end of file diff --git a/FinTrack/ViewModels/NotificationSettingsContentViewModel.cs b/FinTrack/ViewModels/NotificationSettingsContentViewModel.cs new file mode 100644 index 0000000..8bda78e --- /dev/null +++ b/FinTrack/ViewModels/NotificationSettingsContentViewModel.cs @@ -0,0 +1,64 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using FinTrack.Enums; +using FinTrack.Models.Settings; +using Microsoft.Extensions.Logging; +using System.Collections.ObjectModel; +using System.Windows; + +namespace FinTrack.ViewModels +{ + public partial class NotificationSettingsContentViewModel : ObservableObject + { + public ObservableCollection EmailNotificationSettings { get; } + + [ObservableProperty] + private bool enableDesktopNotifications; + + private readonly ILogger _logger; + + public NotificationSettingsContentViewModel(ILogger logger) + { + _logger = logger; + EnableDesktopNotifications = true; + EmailNotificationSettings = new ObservableCollection(); + + LoadSettings(); + } + + private void LoadSettings() + { + foreach (NotificationSettingsType settingType in Enum.GetValues(typeof(NotificationSettingsType))) + { + bool isInitialSelected = settingType switch + { + NotificationSettingsType.SpendingLimitWarning => true, + NotificationSettingsType.ExpectedBillReminder => true, + NotificationSettingsType.WeeklySpendingSummary => false, + NotificationSettingsType.NewFeaturesAndAnnouncements => false, + _ => false + }; + EmailNotificationSettings.Add(new NotificationSettingItemModel(settingType, isInitialSelected)); + } + + EnableDesktopNotifications = true; + } + + [RelayCommand] + private void NotificationSettingsContentChanges() + { + var selectedSettings = EmailNotificationSettings + .Where(setting => setting.IsEnabled) + .Select(setting => setting.SettingType) + .ToList(); + + _logger.LogInformation("Kullanıcı bildirim ayarlarını değiştirdi: {SelectedSettings}", string.Join(", ", selectedSettings)); + MessageBox.Show( + "Bildirim ayarlarınız kaydedildi.", + "Bildirim Ayarları", + MessageBoxButton.OK, + MessageBoxImage.Information + ); + } + } +} diff --git a/FinTrack/ViewModels/ProfileSettingsContentViewModel.cs b/FinTrack/ViewModels/ProfileSettingsContentViewModel.cs new file mode 100644 index 0000000..a1b672b --- /dev/null +++ b/FinTrack/ViewModels/ProfileSettingsContentViewModel.cs @@ -0,0 +1,41 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Microsoft.Extensions.Logging; +using System.Windows; + +namespace FinTrack.ViewModels +{ + public partial class ProfileSettingsContentViewModel : ObservableObject + { + [ObservableProperty] + private string fullName = string.Empty; + + [ObservableProperty] + private string email = string.Empty; + + [ObservableProperty] + private string profilePhotoUrl = string.Empty; + + private readonly ILogger _logger; + + public ProfileSettingsContentViewModel(ILogger logger) + { + _logger = logger; + LoadProfileData(); + } + + private void LoadProfileData() + { + FullName = "John Doe"; + Email = "johndoe@gmail.com"; + ProfilePhotoUrl = "https://example.com/profile-photo.jpg"; + } + + [RelayCommand] + private void ProfileSettingsContentSaveChanges() + { + _logger.LogInformation("Yeni profil bilgileri kaydedildi: {FullName}, {Email}, {ProfilePhotoUrl}", FullName, Email, ProfilePhotoUrl); + MessageBox.Show("Profil bilgileri başarıyla kaydedildi.", "Bilgi", MessageBoxButton.OK, MessageBoxImage.Information); + } + } +} diff --git a/FinTrack/ViewModels/SecuritySettingsContentViewModel.cs b/FinTrack/ViewModels/SecuritySettingsContentViewModel.cs new file mode 100644 index 0000000..8ec4829 --- /dev/null +++ b/FinTrack/ViewModels/SecuritySettingsContentViewModel.cs @@ -0,0 +1,30 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Microsoft.Extensions.Logging; +using System.Windows; + +namespace FinTrack.ViewModels +{ + public partial class SecuritySettingsContentViewModel : ObservableObject + { + [ObservableProperty] + private string currentPassword = string.Empty; + + [ObservableProperty] + private string newPassword = string.Empty; + + readonly ILogger _logger; + + public SecuritySettingsContentViewModel(ILogger logger) + { + _logger = logger; + } + + [RelayCommand] + private void SecuritySettingsContentSaveChanges() + { + _logger.LogInformation("Güvenlik ayarları kaydedildi."); + MessageBox.Show("Güvenlik ayarları kaydedildi.", "Ayarlar", MessageBoxButton.OK, MessageBoxImage.Information); + } + } +} diff --git a/FinTrack/ViewModels/SettingsViewModel.cs b/FinTrack/ViewModels/SettingsViewModel.cs index fac77a7..b935fc5 100644 --- a/FinTrack/ViewModels/SettingsViewModel.cs +++ b/FinTrack/ViewModels/SettingsViewModel.cs @@ -1,8 +1,113 @@ using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; +using Microsoft.Extensions.Logging; +using System.Windows; +using System.Windows.Input; namespace FinTrack.ViewModels { public partial class SettingsViewModel : ObservableObject { + [ObservableProperty] + private string freeButtonStatus = string.Empty; + + [ObservableProperty] + private string plusButtonStatus = string.Empty; + + [ObservableProperty] + private string proButtonStatus = string.Empty; + + [ObservableProperty] + private bool isFreeButtonEnabled = false; + + [ObservableProperty] + private bool isPlusButtonEnabled = true; + + [ObservableProperty] + private bool isProButtonEnabled = true; + + private readonly ILogger _logger; + + private readonly ProfileSettingsContentViewModel profileVM; + private readonly SecuritySettingsContentViewModel securityVM; + private readonly NotificationSettingsContentViewModel notificationsVM; + private readonly AppSettingsContentViewModel appVM; + + [ObservableProperty] + private ObservableObject currentPageViewModel; + + public ICommand ChangePageCommand { get; } + + public SettingsViewModel( + ILogger logger, + ProfileSettingsContentViewModel profileVM, + SecuritySettingsContentViewModel securityVM, + NotificationSettingsContentViewModel notificationsVM, + AppSettingsContentViewModel appVM + ) + { + _logger = logger; + InitializeButtonStatuses(); + this.profileVM = profileVM; + this.securityVM = securityVM; + this.notificationsVM = notificationsVM; + this.appVM = appVM; + + ChangePageCommand = new RelayCommand(ChangePage); + + CurrentPageViewModel = profileVM; + } + + private void ChangePage(string pageName) + { + _logger.LogInformation($"Sayfa değiştiriliyor: {pageName}"); + switch (pageName) + { + case "Profile": + CurrentPageViewModel = profileVM; + break; + case "Security": + CurrentPageViewModel = securityVM; + break; + case "Notifications": + CurrentPageViewModel = notificationsVM; + break; + case "App": + CurrentPageViewModel = appVM; + break; + default: + _logger.LogWarning($"Bilinmeyen sayfa adı: {pageName}"); + break; + } + } + + private void InitializeButtonStatuses() + { + FreeButtonStatus = "Seçili"; + PlusButtonStatus = "Yükselt"; + ProButtonStatus = "Yükselt"; + _logger.LogInformation("Üyelik düğmelerinin durumları ayarlandı."); + } + + [RelayCommand] + private void SelectFreeMembership() + { + _logger.LogInformation("Free üyelik seçildi."); + MessageBox.Show("Free üyelik seçildi.", "Üyelik Seçimi", MessageBoxButton.OK, MessageBoxImage.Information); + } + + [RelayCommand] + private void SelectPlusMembership() + { + _logger.LogInformation("Plus üyelik seçildi."); + MessageBox.Show("Plus üyelik seçildi.", "Üyelik Seçimi", MessageBoxButton.OK, MessageBoxImage.Information); + } + + [RelayCommand] + private void SelectProMembership() + { + _logger.LogInformation("Pro üyelik seçildi."); + MessageBox.Show("Pro üyelik seçildi.", "Üyelik Seçimi", MessageBoxButton.OK, MessageBoxImage.Information); + } } } diff --git a/FinTrack/Views/AppSettingsContentView.xaml b/FinTrack/Views/AppSettingsContentView.xaml new file mode 100644 index 0000000..f88e69c --- /dev/null +++ b/FinTrack/Views/AppSettingsContentView.xaml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +