Flow.Launcher/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs

27 lines
736 B
C#
Raw Permalink Normal View History

2023-04-25 12:04:08 +00:00
using System.Collections.Generic;
using System.Linq;
2025-09-15 05:02:42 +00:00
namespace Flow.Launcher.Plugin.Calculator.ViewModels;
2025-09-15 05:02:42 +00:00
public class SettingsViewModel(Settings settings) : BaseModel
{
2025-09-15 07:18:42 +00:00
public Settings Settings { get; } = settings;
2025-09-15 05:02:42 +00:00
public static IEnumerable<int> MaxDecimalPlacesRange => Enumerable.Range(1, 20);
2025-09-15 05:02:42 +00:00
public List<DecimalSeparatorLocalized> AllDecimalSeparator { get; } = DecimalSeparatorLocalized.GetValues();
2025-09-15 05:02:42 +00:00
public DecimalSeparator SelectedDecimalSeparator
{
get => Settings.DecimalSeparator;
set
{
2025-09-15 05:02:42 +00:00
if (Settings.DecimalSeparator != value)
{
2025-09-15 05:02:42 +00:00
Settings.DecimalSeparator = value;
OnPropertyChanged();
}
}
}
}