Flow.Launcher/Plugins/Flow.Launcher.Plugin.Calculator/ViewModels/SettingsViewModel.cs
VictoriousRaptor 22ffc80aeb Update labels on language change and other refactor
- Bring back viewmodel construction on init
- Remove redundant init code
2025-07-22 23:48:39 +08:00

32 lines
891 B
C#

using System.Collections.Generic;
using System.Linq;
namespace Flow.Launcher.Plugin.Calculator.ViewModels
{
public class SettingsViewModel : BaseModel
{
public SettingsViewModel(Settings settings)
{
Settings = settings;
}
public Settings Settings { get; init; }
public static IEnumerable<int> MaxDecimalPlacesRange => Enumerable.Range(1, 20);
public List<DecimalSeparatorLocalized> AllDecimalSeparator { get; } = DecimalSeparatorLocalized.GetValues();
public DecimalSeparator SelectedDecimalSeparator
{
get => Settings.DecimalSeparator;
set
{
if (Settings.DecimalSeparator != value)
{
Settings.DecimalSeparator = value;
OnPropertyChanged();
}
}
}
}
}