Skip to content

Commit 659c96b

Browse files
authored
Merge pull request #10 from EnesEfeTokta/Develop
Develop
2 parents 5291cfc + 3f5b0b1 commit 659c96b

20 files changed

+704
-43
lines changed

FinTrack/App.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,14 @@ private void ConfigureServices(IServiceCollection services)
6060
services.AddTransient<DebtViewModel>();
6161
services.AddTransient<SettingsViewModel>();
6262
services.AddTransient<FeedbackViewModel>();
63+
64+
services.AddTransient<SettingsView>();
65+
6366
services.AddTransient<NotificationViewModel>();
67+
services.AddTransient<ProfileSettingsContentViewModel>();
68+
services.AddTransient<SecuritySettingsContentViewModel>();
69+
services.AddTransient<NotificationSettingsContentViewModel>();
70+
services.AddTransient<AppSettingsContentViewModel>();
6471

6572
services.AddTransient<AccountView>();
6673

FinTrack/Enums/AppearanceType.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
using System.ComponentModel;
2+
3+
namespace FinTrack.Enums
4+
{
5+
public enum AppearanceType
6+
{
7+
[Description("Light Mode")]
8+
Light,
9+
10+
[Description("Dark Mode")]
11+
Dark,
12+
13+
[Description("System Default")]
14+
SystemDefault
15+
}
16+
}

FinTrack/Enums/BaseCurrencyType.cs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
using System.ComponentModel;
2+
3+
namespace FinTrack.Enums
4+
{
5+
public enum BaseCurrencyType
6+
{
7+
[Description("TRY - Turkish Lira")]
8+
TRY,
9+
10+
[Description("USD - United States Dollar")]
11+
USD,
12+
13+
[Description("EUR - Euro")]
14+
EUR,
15+
16+
[Description("GBP - British Pound")]
17+
GBP,
18+
19+
[Description("JPY - Japanese Yen")]
20+
JPY,
21+
22+
[Description("AUD - Australian Dollar")]
23+
AUD,
24+
25+
[Description("CAD - Canadian Dollar")]
26+
CAD,
27+
28+
[Description("CHF - Swiss Franc")]
29+
CHF
30+
}
31+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using System.ComponentModel;
2+
3+
namespace FinTrack.Enums
4+
{
5+
public enum NotificationSettingsType
6+
{
7+
[Description("Spending limit warning")]
8+
SpendingLimitWarning,
9+
10+
[Description("Expected bill reminder")]
11+
ExpectedBillReminder,
12+
13+
[Description("Weekly spending summary")]
14+
WeeklySpendingSummary,
15+
16+
[Description("New features and announcements")]
17+
NewFeaturesAndAnnouncements
18+
}
19+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using FinTrack.Enums;
3+
4+
namespace FinTrack.Models.Settings
5+
{
6+
public partial class NotificationSettingItemModel : ObservableObject
7+
{
8+
public NotificationSettingsType SettingType { get; set; }
9+
10+
[ObservableProperty]
11+
private bool isEnabled;
12+
13+
public NotificationSettingItemModel(NotificationSettingsType settingType, bool isEnabled)
14+
{
15+
SettingType = settingType;
16+
this.isEnabled = isEnabled;
17+
}
18+
}
19+
}

FinTrack/Styles/ModernStyles.xaml

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,6 @@
665665
</Style>
666666

667667
<!-- 1. ToggleButton Stili (ComboBox'ın açma/kapama düğmesi için) -->
668-
<!-- Bu stil, ana ComboBox stilinden ÖNCE tanımlanmalıdır. -->
669668
<Style x:Key="ComboBoxToggleButtonModernStyle" TargetType="{x:Type ToggleButton}">
670669
<Setter Property="OverridesDefaultStyle" Value="true"/>
671670
<Setter Property="Template">
@@ -943,5 +942,60 @@
943942
<Setter Property="CommandParameter" Value="{Binding Content, RelativeSource={RelativeSource Self}}"/>
944943
<Setter Property="Width" Value="150"/>
945944
</Style>
945+
946+
<Style x:Key="ModernCheckBoxStyle" TargetType="CheckBox">
947+
<Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
948+
<Setter Property="Background" Value="Transparent"/>
949+
<Setter Property="BorderBrush" Value="{StaticResource TopBarTextSecondaryBrush}"/>
950+
<Setter Property="BorderThickness" Value="1"/>
951+
<Setter Property="Cursor" Value="Hand"/>
952+
<Setter Property="VerticalContentAlignment" Value="Center"/>
953+
<Setter Property="Template">
954+
<Setter.Value>
955+
<ControlTemplate TargetType="CheckBox">
956+
<StackPanel Orientation="Horizontal">
957+
<!-- CheckBox Kutusu ve İşareti için bir Grid -->
958+
<Grid Width="20" Height="20" VerticalAlignment="Center">
959+
<!-- Kutu için Border -->
960+
<Border x:Name="CheckBoxBorder"
961+
Background="{TemplateBinding Background}"
962+
BorderBrush="{TemplateBinding BorderBrush}"
963+
BorderThickness="{TemplateBinding BorderThickness}"
964+
CornerRadius="3"/>
965+
<!-- Onay İşareti için Path (sadece işaretliyken görünür) -->
966+
<Path x:Name="CheckMark"
967+
Data="M 4,10 L 8,14 L 16,6"
968+
Stroke="{StaticResource MainBackgroundBrush}"
969+
StrokeThickness="2.5"
970+
StrokeStartLineCap="Round"
971+
StrokeEndLineCap="Round"
972+
StrokeLineJoin="Round"
973+
Opacity="0"/>
974+
</Grid>
975+
<!-- CheckBox Metni -->
976+
<ContentPresenter Margin="10,0,0,0"
977+
VerticalAlignment="Center"
978+
RecognizesAccessKey="True"/>
979+
</StackPanel>
980+
<ControlTemplate.Triggers>
981+
<!-- Fare üzerine gelince -->
982+
<Trigger Property="IsMouseOver" Value="True">
983+
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{StaticResource PrimaryAccentBrush}"/>
984+
</Trigger>
985+
<!-- İşaretli olduğunda -->
986+
<Trigger Property="IsChecked" Value="True">
987+
<Setter TargetName="CheckBoxBorder" Property="Background" Value="{StaticResource PrimaryAccentBrush}"/>
988+
<Setter TargetName="CheckBoxBorder" Property="BorderBrush" Value="{StaticResource PrimaryAccentBrush}"/>
989+
<Setter TargetName="CheckMark" Property="Opacity" Value="1"/>
990+
</Trigger>
991+
<!-- Devre dışı bırakıldığında -->
992+
<Trigger Property="IsEnabled" Value="False">
993+
<Setter Property="Opacity" Value="0.5"/>
994+
</Trigger>
995+
</ControlTemplate.Triggers>
996+
</ControlTemplate>
997+
</Setter.Value>
998+
</Setter>
999+
</Style>
9461000

9471001
</ResourceDictionary>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using CommunityToolkit.Mvvm.Input;
3+
using FinTrack.Enums;
4+
using Microsoft.Extensions.Logging;
5+
using System.Collections.ObjectModel;
6+
using System.Windows;
7+
8+
namespace FinTrack.ViewModels
9+
{
10+
public partial class AppSettingsContentViewModel : ObservableObject
11+
{
12+
public ObservableCollection<AppearanceType> AppearanceTypes { get; }
13+
14+
public ObservableCollection<BaseCurrencyType> CurrencyTypes { get; }
15+
16+
[ObservableProperty]
17+
private bool isFirstOpening = true;
18+
19+
private readonly ILogger<AppSettingsContentViewModel> _logger;
20+
21+
public AppSettingsContentViewModel(ILogger<AppSettingsContentViewModel> logger)
22+
{
23+
_logger = logger;
24+
AppearanceTypes = new ObservableCollection<AppearanceType>();
25+
CurrencyTypes = new ObservableCollection<BaseCurrencyType>();
26+
27+
InitializeAppearanceTypes();
28+
}
29+
30+
private void InitializeAppearanceTypes()
31+
{
32+
AppearanceTypes.Clear();
33+
foreach (AppearanceType appearanceType in Enum.GetValues(typeof(AppearanceType)))
34+
{
35+
AppearanceTypes.Add(appearanceType);
36+
}
37+
38+
CurrencyTypes.Clear();
39+
foreach (BaseCurrencyType currencyType in Enum.GetValues(typeof(BaseCurrencyType)))
40+
{
41+
CurrencyTypes.Add(currencyType);
42+
}
43+
}
44+
45+
[RelayCommand]
46+
private void AppSettingsContentChanges()
47+
{
48+
_logger.LogInformation("Kullanıcı uygulama ayarlarını değiştirdi. İlk açılış: {IsFirstOpening}", IsFirstOpening);
49+
MessageBox.Show("Kullanıcı uygulama ayarlarını değiştirdi.",
50+
"Uygulama Ayarları",
51+
MessageBoxButton.OK,
52+
MessageBoxImage.Information);
53+
}
54+
}
55+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using CommunityToolkit.Mvvm.Input;
3+
using FinTrack.Enums;
4+
using FinTrack.Models.Settings;
5+
using Microsoft.Extensions.Logging;
6+
using System.Collections.ObjectModel;
7+
using System.Windows;
8+
9+
namespace FinTrack.ViewModels
10+
{
11+
public partial class NotificationSettingsContentViewModel : ObservableObject
12+
{
13+
public ObservableCollection<NotificationSettingItemModel> EmailNotificationSettings { get; }
14+
15+
[ObservableProperty]
16+
private bool enableDesktopNotifications;
17+
18+
private readonly ILogger<NotificationSettingsContentViewModel> _logger;
19+
20+
public NotificationSettingsContentViewModel(ILogger<NotificationSettingsContentViewModel> logger)
21+
{
22+
_logger = logger;
23+
EnableDesktopNotifications = true;
24+
EmailNotificationSettings = new ObservableCollection<NotificationSettingItemModel>();
25+
26+
LoadSettings();
27+
}
28+
29+
private void LoadSettings()
30+
{
31+
foreach (NotificationSettingsType settingType in Enum.GetValues(typeof(NotificationSettingsType)))
32+
{
33+
bool isInitialSelected = settingType switch
34+
{
35+
NotificationSettingsType.SpendingLimitWarning => true,
36+
NotificationSettingsType.ExpectedBillReminder => true,
37+
NotificationSettingsType.WeeklySpendingSummary => false,
38+
NotificationSettingsType.NewFeaturesAndAnnouncements => false,
39+
_ => false
40+
};
41+
EmailNotificationSettings.Add(new NotificationSettingItemModel(settingType, isInitialSelected));
42+
}
43+
44+
EnableDesktopNotifications = true;
45+
}
46+
47+
[RelayCommand]
48+
private void NotificationSettingsContentChanges()
49+
{
50+
var selectedSettings = EmailNotificationSettings
51+
.Where(setting => setting.IsEnabled)
52+
.Select(setting => setting.SettingType)
53+
.ToList();
54+
55+
_logger.LogInformation("Kullanıcı bildirim ayarlarını değiştirdi: {SelectedSettings}", string.Join(", ", selectedSettings));
56+
MessageBox.Show(
57+
"Bildirim ayarlarınız kaydedildi.",
58+
"Bildirim Ayarları",
59+
MessageBoxButton.OK,
60+
MessageBoxImage.Information
61+
);
62+
}
63+
}
64+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using CommunityToolkit.Mvvm.Input;
3+
using Microsoft.Extensions.Logging;
4+
using System.Windows;
5+
6+
namespace FinTrack.ViewModels
7+
{
8+
public partial class ProfileSettingsContentViewModel : ObservableObject
9+
{
10+
[ObservableProperty]
11+
private string fullName = string.Empty;
12+
13+
[ObservableProperty]
14+
private string email = string.Empty;
15+
16+
[ObservableProperty]
17+
private string profilePhotoUrl = string.Empty;
18+
19+
private readonly ILogger<ProfileSettingsContentViewModel> _logger;
20+
21+
public ProfileSettingsContentViewModel(ILogger<ProfileSettingsContentViewModel> logger)
22+
{
23+
_logger = logger;
24+
LoadProfileData();
25+
}
26+
27+
private void LoadProfileData()
28+
{
29+
FullName = "John Doe";
30+
Email = "johndoe@gmail.com";
31+
ProfilePhotoUrl = "https://example.com/profile-photo.jpg";
32+
}
33+
34+
[RelayCommand]
35+
private void ProfileSettingsContentSaveChanges()
36+
{
37+
_logger.LogInformation("Yeni profil bilgileri kaydedildi: {FullName}, {Email}, {ProfilePhotoUrl}", FullName, Email, ProfilePhotoUrl);
38+
MessageBox.Show("Profil bilgileri başarıyla kaydedildi.", "Bilgi", MessageBoxButton.OK, MessageBoxImage.Information);
39+
}
40+
}
41+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using CommunityToolkit.Mvvm.ComponentModel;
2+
using CommunityToolkit.Mvvm.Input;
3+
using Microsoft.Extensions.Logging;
4+
using System.Windows;
5+
6+
namespace FinTrack.ViewModels
7+
{
8+
public partial class SecuritySettingsContentViewModel : ObservableObject
9+
{
10+
[ObservableProperty]
11+
private string currentPassword = string.Empty;
12+
13+
[ObservableProperty]
14+
private string newPassword = string.Empty;
15+
16+
readonly ILogger<SecuritySettingsContentViewModel> _logger;
17+
18+
public SecuritySettingsContentViewModel(ILogger<SecuritySettingsContentViewModel> logger)
19+
{
20+
_logger = logger;
21+
}
22+
23+
[RelayCommand]
24+
private void SecuritySettingsContentSaveChanges()
25+
{
26+
_logger.LogInformation("Güvenlik ayarları kaydedildi.");
27+
MessageBox.Show("Güvenlik ayarları kaydedildi.", "Ayarlar", MessageBoxButton.OK, MessageBoxImage.Information);
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)