2023-04-25 12:04:08 +00:00
|
|
|
|
using System.Collections.Generic;
|
2020-03-31 11:00:09 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
2025-09-15 05:02:42 +00:00
|
|
|
|
namespace Flow.Launcher.Plugin.Calculator.ViewModels;
|
2020-03-31 11:00:09 +00:00
|
|
|
|
|
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;
|
2020-03-31 11:00:09 +00:00
|
|
|
|
|
2025-09-15 05:02:42 +00:00
|
|
|
|
public static IEnumerable<int> MaxDecimalPlacesRange => Enumerable.Range(1, 20);
|
2025-06-23 04:25:16 +00:00
|
|
|
|
|
2025-09-15 05:02:42 +00:00
|
|
|
|
public List<DecimalSeparatorLocalized> AllDecimalSeparator { get; } = DecimalSeparatorLocalized.GetValues();
|
2025-06-23 04:25:16 +00:00
|
|
|
|
|
2025-09-15 05:02:42 +00:00
|
|
|
|
public DecimalSeparator SelectedDecimalSeparator
|
|
|
|
|
|
{
|
|
|
|
|
|
get => Settings.DecimalSeparator;
|
|
|
|
|
|
set
|
2025-06-23 04:25:16 +00:00
|
|
|
|
{
|
2025-09-15 05:02:42 +00:00
|
|
|
|
if (Settings.DecimalSeparator != value)
|
2025-06-23 04:25:16 +00:00
|
|
|
|
{
|
2025-09-15 05:02:42 +00:00
|
|
|
|
Settings.DecimalSeparator = value;
|
|
|
|
|
|
OnPropertyChanged();
|
2025-06-23 04:25:16 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-03-31 11:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|