Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions FinTrack/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,14 @@ private void ConfigureServices(IServiceCollection services)
services.AddTransient<DebtViewModel>();
services.AddTransient<SettingsViewModel>();
services.AddTransient<FeedbackViewModel>();

services.AddTransient<SettingsView>();

services.AddTransient<NotificationViewModel>();
services.AddTransient<ProfileSettingsContentViewModel>();
services.AddTransient<SecuritySettingsContentViewModel>();
services.AddTransient<NotificationSettingsContentViewModel>();
services.AddTransient<AppSettingsContentViewModel>();

services.AddTransient<AccountView>();

Expand Down
16 changes: 16 additions & 0 deletions FinTrack/Enums/AppearanceType.cs
Original file line number Diff line number Diff line change
@@ -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
}
}
31 changes: 31 additions & 0 deletions FinTrack/Enums/BaseCurrencyType.cs
Original file line number Diff line number Diff line change
@@ -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
}
}
19 changes: 19 additions & 0 deletions FinTrack/Enums/NotificationSettingsType.cs
Original file line number Diff line number Diff line change
@@ -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
}
}
19 changes: 19 additions & 0 deletions FinTrack/Models/Settings/NotificationSettingItemModel.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
56 changes: 55 additions & 1 deletion FinTrack/Styles/ModernStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -665,7 +665,6 @@
</Style>

<!-- 1. ToggleButton Stili (ComboBox'ın açma/kapama düğmesi için) -->
<!-- Bu stil, ana ComboBox stilinden ÖNCE tanımlanmalıdır. -->
<Style x:Key="ComboBoxToggleButtonModernStyle" TargetType="{x:Type ToggleButton}">
<Setter Property="OverridesDefaultStyle" Value="true"/>
<Setter Property="Template">
Expand Down Expand Up @@ -943,5 +942,60 @@
<Setter Property="CommandParameter" Value="{Binding Content, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Width" Value="150"/>
</Style>

<Style x:Key="ModernCheckBoxStyle" TargetType="CheckBox">
<Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="{StaticResource TopBarTextSecondaryBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<StackPanel Orientation="Horizontal">
<!-- CheckBox Kutusu ve İşareti için bir Grid -->
<Grid Width="20" Height="20" VerticalAlignment="Center">
<!-- Kutu için Border -->
<Border x:Name="CheckBoxBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="3"/>
<!-- Onay İşareti için Path (sadece işaretliyken görünür) -->
<Path x:Name="CheckMark"
Data="M 4,10 L 8,14 L 16,6"
Stroke="{StaticResource MainBackgroundBrush}"
StrokeThickness="2.5"
StrokeStartLineCap="Round"
StrokeEndLineCap="Round"
StrokeLineJoin="Round"
Opacity="0"/>
</Grid>
<!-- CheckBox Metni -->
<ContentPresenter Margin="10,0,0,0"
VerticalAlignment="Center"
RecognizesAccessKey="True"/>
</StackPanel>
<ControlTemplate.Triggers>
<!-- Fare üzerine gelince -->
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{StaticResource PrimaryAccentBrush}"/>
</Trigger>
<!-- İşaretli olduğunda -->
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{StaticResource PrimaryAccentBrush}"/>
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{StaticResource PrimaryAccentBrush}"/>
<Setter TargetName="CheckMark" Property="Opacity" Value="1"/>
</Trigger>
<!-- Devre dışı bırakıldığında -->
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

</ResourceDictionary>
55 changes: 55 additions & 0 deletions FinTrack/ViewModels/AppSettingsContentViewModel.cs
Original file line number Diff line number Diff line change
@@ -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<AppearanceType> AppearanceTypes { get; }

public ObservableCollection<BaseCurrencyType> CurrencyTypes { get; }

[ObservableProperty]
private bool isFirstOpening = true;

private readonly ILogger<AppSettingsContentViewModel> _logger;

public AppSettingsContentViewModel(ILogger<AppSettingsContentViewModel> logger)
{
_logger = logger;
AppearanceTypes = new ObservableCollection<AppearanceType>();
CurrencyTypes = new ObservableCollection<BaseCurrencyType>();

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);
}
}
}
64 changes: 64 additions & 0 deletions FinTrack/ViewModels/NotificationSettingsContentViewModel.cs
Original file line number Diff line number Diff line change
@@ -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<NotificationSettingItemModel> EmailNotificationSettings { get; }

[ObservableProperty]
private bool enableDesktopNotifications;

private readonly ILogger<NotificationSettingsContentViewModel> _logger;

public NotificationSettingsContentViewModel(ILogger<NotificationSettingsContentViewModel> logger)
{
_logger = logger;
EnableDesktopNotifications = true;
EmailNotificationSettings = new ObservableCollection<NotificationSettingItemModel>();

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
);
}
}
}
41 changes: 41 additions & 0 deletions FinTrack/ViewModels/ProfileSettingsContentViewModel.cs
Original file line number Diff line number Diff line change
@@ -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<ProfileSettingsContentViewModel> _logger;

public ProfileSettingsContentViewModel(ILogger<ProfileSettingsContentViewModel> 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);
}
}
}
30 changes: 30 additions & 0 deletions FinTrack/ViewModels/SecuritySettingsContentViewModel.cs
Original file line number Diff line number Diff line change
@@ -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<SecuritySettingsContentViewModel> _logger;

public SecuritySettingsContentViewModel(ILogger<SecuritySettingsContentViewModel> logger)
{
_logger = logger;
}

[RelayCommand]
private void SecuritySettingsContentSaveChanges()
{
_logger.LogInformation("Güvenlik ayarları kaydedildi.");
MessageBox.Show("Güvenlik ayarları kaydedildi.", "Ayarlar", MessageBoxButton.OK, MessageBoxImage.Information);
}
}
}
Loading
Loading