-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathConfigurationPage.xaml.cs
61 lines (52 loc) · 1.13 KB
/
ConfigurationPage.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
namespace PracticaPalabrasMAUI;
public partial class ConfigurationPage : ContentPage
{
public static ConfigurationPage Instance { get; set; } = new ConfigurationPage();
public ConfigurationPage()
{
InitializeComponent();
Instance = this;
BindingContext = this;
}
public int ImagineRate
{
get => Preferences.Get(nameof(ImagineRate), 1);
set
{
if (value < 0)
{
value = 0;
}
Preferences.Set(nameof(ImagineRate), value);
OnPropertyChanged();
OnPropertyChanged(nameof(IsImagineDisabled));
}
}
public bool IsImagineDisabled => ImagineRate == 0;
public bool SpeakAllWord
{
get => Speak.SpeakAllWord;
set
{
Speak.SpeakAllWord = value;
OnPropertyChanged();
}
}
public bool SortDictionary
{
get => Preferences.Get(nameof(SortDictionary), false);
set
{
Preferences.Set(nameof(SortDictionary), value);
OnPropertyChanged();
}
}
private void TapChangeSpeak(object sender, TappedEventArgs e)
{
SpeakAllWord = !SpeakAllWord;
}
private void TapChangeSort(object sender, TappedEventArgs e)
{
SortDictionary=!SortDictionary;
}
}