Class SettingsViewModel
Appearance and notification settings, kept in the Ui section of the app's settings.json and saved on every change.
Inheritance
SettingsViewModel
Assembly: Uniform.Chat.Avalonia.dll
public sealed class SettingsViewModel : ViewModelBase, INotifyPropertyChanged, INotifyPropertyChanging
Constructors
|
Edit this page
View Source
Load the settings of applicationName; canNotify tells whether the platform shows notifications, platform, when given, offers its audio for the audio test and its push distributors, and dispatcher brings the distributors' answers to the user interface thread.
Declaration
public SettingsViewModel(string applicationName, bool canNotify, GuiPlatform? platform = null, IUiDispatcher? dispatcher = null)
Parameters
Fields
|
Edit this page
View Source
Section of the settings file.
Declaration
public const string Section = "Ui"
Field Value
Properties
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("ShowsSettings")]
[ExcludeFromCodeCoverage]
public AudioTestViewModel? AudioTest { get; set; }
Property Value
|
Edit this page
View Source
Whether the platform shows notifications, so the switch is offered.
Declaration
public bool CanNotify { get; }
Property Value
|
Edit this page
View Source
Whether the system's notification settings of the app can be opened from here.
Declaration
public bool CanOpenNotificationSettings { get; }
Property Value
|
Edit this page
View Source
Whether the platform can receive push messages, so their choice is offered.
Declaration
public bool CanPush { get; }
Property Value
|
Edit this page
View Source
Whether the platform rings for incoming calls, so that ringing is a choice.
Declaration
public bool CanRing { get; }
Property Value
|
Edit this page
View Source
Whether there are logs to show.
Declaration
public bool CanShowLogs { get; }
Property Value
|
Edit this page
View Source
Whether the platform has audio to test.
Declaration
public bool CanTestAudio { get; }
Property Value
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand CloseAudioTestCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SettingsViewModel.CloseLicenses().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand CloseLicensesCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SettingsViewModel.CloseLogs().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand CloseLogsCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("ShowsSettings")]
[ExcludeFromCodeCoverage]
public LicensesViewModel? Licenses { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("CanShowLogs")]
[ExcludeFromCodeCoverage]
public string? LogPath { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("ShowsSettings")]
[ExcludeFromCodeCoverage]
public LogsViewModel? Logs { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool NotificationsBlocked { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool NotifyCalls { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool NotifyDirectMessages { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool NotifyInvites { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public bool NotifyMentions { get; set; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SettingsViewModel.OpenNotificationSettings().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand OpenNotificationSettingsCommand { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public int PushChoiceIndex { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public IReadOnlyList<string> PushChoices { get; set; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[ExcludeFromCodeCoverage]
public string PushStatus { get; set; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SettingsViewModel.RefreshPush().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand RefreshPushCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SettingsViewModel.ShowAudioTest().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand ShowAudioTestCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SettingsViewModel.ShowLicenses().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand ShowLicensesCommand { get; }
Property Value
Gets an IRelayCommand instance wrapping Uniform.Chat.Avalonia.ViewModels.SettingsViewModel.ShowLogs().
Declaration
[ExcludeFromCodeCoverage]
public IRelayCommand ShowLogsCommand { get; }
Property Value
|
Edit this page
View Source
Whether the settings are shown rather than the licenses, the logs or the audio test.
Declaration
public bool ShowsSettings { get; }
Property Value
|
Edit this page
View Source
TextSize
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("TextSizeIndex")]
[ExcludeFromCodeCoverage]
public double TextSize { get; set; }
Property Value
|
Edit this page
View Source
TextSizeIndex
Declaration
public int TextSizeIndex { get; set; }
Property Value
|
Edit this page
View Source
TextSizes
Text sizes to choose from: very small, small, normal, large and very large.
Declaration
public IReadOnlyList<double> TextSizes { get; }
Property Value
|
Edit this page
View Source
Declaration
[ObservableProperty]
[NotifyPropertyChangedFor("ThemeIndex")]
[ExcludeFromCodeCoverage]
public AppTheme Theme { get; set; }
Property Value
|
Edit this page
View Source
Get or set Theme as an index of Themes, for the picker.
Declaration
public int ThemeIndex { get; set; }
Property Value
|
Edit this page
View Source
Themes to choose from, in AppTheme order.
Declaration
public IReadOnlyList<string> Themes { get; }
Property Value
|
Edit this page
View Source
VersionText
The app's version, e.g. Uniform Chat 0.1.36 (6078a19), the same on the desktop and Android.
Declaration
public static string VersionText { get; }
Property Value
Methods
|
Edit this page
View Source
Stop the audio test and go back to the settings.
Declaration
[RelayCommand]
public void CloseAudioTest()
|
Edit this page
View Source
Read again whether the app may notify, e.g. after asking or when the settings open, as it may have been changed in the system's settings.
Declaration
public void RefreshNotificationsAllowed()
Implements