2023-04-25 12:04:08 +00:00
|
|
|
|
using System.Collections.Generic;
|
2020-03-31 11:00:09 +00:00
|
|
|
|
using System.Linq;
|
|
|
|
|
|
|
2024-05-25 06:35:14 +00:00
|
|
|
|
namespace Flow.Launcher.Plugin.Calculator.ViewModels
|
2020-03-31 11:00:09 +00:00
|
|
|
|
{
|
2021-05-11 16:37:28 +00:00
|
|
|
|
public class SettingsViewModel : BaseModel
|
2020-03-31 11:00:09 +00:00
|
|
|
|
{
|
2021-05-12 11:38:29 +00:00
|
|
|
|
public SettingsViewModel(Settings settings)
|
2020-03-31 11:00:09 +00:00
|
|
|
|
{
|
2021-05-12 11:38:29 +00:00
|
|
|
|
Settings = settings;
|
2020-03-31 11:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2021-05-12 11:38:29 +00:00
|
|
|
|
public Settings Settings { get; init; }
|
2020-03-31 11:00:09 +00:00
|
|
|
|
|
2025-07-22 15:48:39 +00:00
|
|
|
|
public static IEnumerable<int> MaxDecimalPlacesRange => Enumerable.Range(1, 20);
|
2025-06-23 04:25:16 +00:00
|
|
|
|
|
|
|
|
|
|
public List<DecimalSeparatorLocalized> AllDecimalSeparator { get; } = DecimalSeparatorLocalized.GetValues();
|
|
|
|
|
|
|
|
|
|
|
|
public DecimalSeparator SelectedDecimalSeparator
|
|
|
|
|
|
{
|
|
|
|
|
|
get => Settings.DecimalSeparator;
|
|
|
|
|
|
set
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Settings.DecimalSeparator != value)
|
|
|
|
|
|
{
|
|
|
|
|
|
Settings.DecimalSeparator = value;
|
|
|
|
|
|
OnPropertyChanged();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-03-31 11:00:09 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|