@@ -34,7 +34,7 @@ public FontSettingViewModel()
34
34
35
35
#region Change Color
36
36
[ RelayCommand ]
37
- private async void OnChooseColor ( string settingType )
37
+ private async Task OnChooseColor ( string settingType )
38
38
{
39
39
var scrollViewer = new ScrollViewer { Margin = new Thickness ( 10 ) } ;
40
40
var colorPicker = new ColorPicker
@@ -43,7 +43,7 @@ private async void OnChooseColor(string settingType)
43
43
IsMoreButtonVisible = false ,
44
44
IsColorSliderVisible = true ,
45
45
IsColorChannelTextInputVisible = false ,
46
- IsHexInputVisible = false ,
46
+ IsHexInputVisible = true ,
47
47
IsAlphaEnabled = false ,
48
48
IsAlphaSliderVisible = false ,
49
49
IsAlphaTextInputVisible = false ,
@@ -52,21 +52,29 @@ private async void OnChooseColor(string settingType)
52
52
53
53
colorPicker . ColorChanged += ( s , e ) =>
54
54
{
55
- var selectedColor = new SolidColorBrush ( e . NewColor ) ;
56
- switch ( settingType )
55
+ try
56
+ {
57
+ var selectedColor = new SolidColorBrush ( e . NewColor ) ;
58
+ switch ( settingType )
59
+ {
60
+ case "Aya" :
61
+ TxtAyaForeground = selectedColor ;
62
+ Settings . AyatForeground = e . NewColor . ToString ( ) ;
63
+ break ;
64
+ case "AyaNumber" :
65
+ TxtAyaNumberForeground = selectedColor ;
66
+ Settings . AyatNumberForeground = e . NewColor . ToString ( ) ;
67
+ break ;
68
+ case "Translation" :
69
+ TxtTranslationForeground = selectedColor ;
70
+ Settings . TranslationForeground = e . NewColor . ToString ( ) ;
71
+ break ;
72
+ }
73
+
74
+ FontSettingPage . Instance . RefreshTextBlockForeground ( ) ;
75
+ }
76
+ catch ( Exception )
57
77
{
58
- case "Aya" :
59
- TxtAyaForeground = selectedColor ;
60
- Settings . AyatForeground = e . NewColor . ToString ( ) ;
61
- break ;
62
- case "AyaNumber" :
63
- TxtAyaNumberForeground = selectedColor ;
64
- Settings . AyatNumberForeground = e . NewColor . ToString ( ) ;
65
- break ;
66
- case "Translation" :
67
- TxtTranslationForeground = selectedColor ;
68
- Settings . TranslationForeground = e . NewColor . ToString ( ) ;
69
- break ;
70
78
}
71
79
} ;
72
80
@@ -79,6 +87,8 @@ private async void OnChooseColor(string settingType)
79
87
} ;
80
88
contentDialog . Title = "انتخاب رنگ" ;
81
89
contentDialog . PrimaryButtonText = "تایید" ;
90
+ contentDialog . SecondaryButtonText = "انصراف" ;
91
+ contentDialog . PrimaryButtonStyle = ( Style ) Application . Current . Resources [ "AccentButtonStyle" ] ;
82
92
contentDialog . FlowDirection = FlowDirection . RightToLeft ;
83
93
await contentDialog . ShowAsyncQueue ( ) ;
84
94
}
@@ -90,6 +100,7 @@ private void OnResetColors()
90
100
Settings . AyatNumberForeground = null ;
91
101
Settings . TranslationForeground = null ;
92
102
GetDefaultColors ( ) ;
103
+ FontSettingPage . Instance . RefreshTextBlockForeground2 ( ) ;
93
104
}
94
105
95
106
private void GetDefaultColors ( )
0 commit comments