mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-14 07:43:31 -07:00
43 lines
1.1 KiB
C#
43 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using DiscordChatExporter.Models;
|
|
using DiscordChatExporter.Services;
|
|
using GalaSoft.MvvmLight;
|
|
using Tyrrrz.Extensions;
|
|
|
|
namespace DiscordChatExporter.ViewModels
|
|
{
|
|
public class SettingsViewModel : ViewModelBase, ISettingsViewModel
|
|
{
|
|
private readonly ISettingsService _settingsService;
|
|
|
|
public IReadOnlyList<Theme> AvailableThemes { get; }
|
|
|
|
public Theme Theme
|
|
{
|
|
get => _settingsService.Theme;
|
|
set => _settingsService.Theme = value;
|
|
}
|
|
|
|
public string DateFormat
|
|
{
|
|
get => _settingsService.DateFormat;
|
|
set => _settingsService.DateFormat = value;
|
|
}
|
|
|
|
public int MessageGroupLimit
|
|
{
|
|
get => _settingsService.MessageGroupLimit;
|
|
set => _settingsService.MessageGroupLimit = value.ClampMin(0);
|
|
}
|
|
|
|
public SettingsViewModel(ISettingsService settingsService)
|
|
{
|
|
_settingsService = settingsService;
|
|
|
|
// Defaults
|
|
AvailableThemes = Enum.GetValues(typeof(Theme)).Cast<Theme>().ToArray();
|
|
}
|
|
}
|
|
} |