Skip to content

Commit 76f538a

Browse files
committed
Updated Xaml and code behind files based on the review.
1 parent 8083b07 commit 76f538a

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

ThemeSample/MainPage.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
<buttons:SfButton
1313
x:Name="CounterBtn"
1414
Text="Click me"
15-
SemanticProperties.Hint="Counts the number of times you click"
1615
Clicked="OnCounterClicked"
1716
HorizontalOptions="Fill" />
1817
</VerticalStackLayout>

ThemeSample/MainPage.xaml.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,20 @@ private void OnCounterClicked(object sender, EventArgs e)
1818
if (count == 1)
1919
CounterBtn.Text = $"Clicked {count} time";
2020
else
21-
CounterBtn.Text = $"Clicked {count} times";
22-
23-
SemanticScreenReader.Announce(CounterBtn.Text);
24-
21+
CounterBtn.Text = $"Clicked {count} times";
2522
}
2623

2724
protected override void OnAppearing()
2825
{
2926
if (Application.Current != null)
3027
{
3128
this.ApplyTheme(Application.Current.RequestedTheme);
32-
Application.Current.RequestedThemeChanged += Current_RequestedThemeChanged;
29+
Application.Current.RequestedThemeChanged += OnRequestedThemeChanged;
3330
}
3431
base.OnAppearing();
3532
}
3633

37-
private void Current_RequestedThemeChanged(object? sender, AppThemeChangedEventArgs e)
34+
private void OnRequestedThemeChanged(object? sender, AppThemeChangedEventArgs e)
3835
{
3936
this.ApplyTheme(e.RequestedTheme);
4037
}
@@ -46,16 +43,16 @@ public void ApplyTheme(AppTheme appTheme)
4643
ICollection<ResourceDictionary> mergedDictionaries = Application.Current.Resources.MergedDictionaries;
4744
if (mergedDictionaries != null)
4845
{
49-
var theme = mergedDictionaries.OfType<SyncfusionThemeResourceDictionary>().FirstOrDefault();
50-
if (theme != null)
46+
var syncTheme = mergedDictionaries.OfType<SyncfusionThemeResourceDictionary>().FirstOrDefault();
47+
if (syncTheme != null)
5148
{
5249
if (appTheme is AppTheme.Light)
5350
{
54-
theme.VisualTheme = SfVisuals.MaterialLight;
51+
syncTheme.VisualTheme = SfVisuals.MaterialLight;
5552
}
5653
else
5754
{
58-
theme.VisualTheme = SfVisuals.MaterialDark;
55+
syncTheme.VisualTheme = SfVisuals.MaterialDark;
5956
}
6057
}
6158
}

0 commit comments

Comments
 (0)