Archived
1
0

Development 110218

This commit is contained in:
Michael Gordeev
2018-11-02 10:33:34 +03:00
parent 3126b9cf19
commit bba4fe4f00
16 changed files with 400 additions and 125 deletions
+12 -3
View File
@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
@@ -90,9 +91,13 @@ namespace FoxTube.Pages.SettingsPages
settings.Values["videoAutoplay"] = autoplay.IsOn;
}
private void notification_IsEnabledChanged(object sender, RoutedEventArgs e)
private async void notification_IsEnabledChanged(object sender, RoutedEventArgs e)
{
settings.Values["newVideoNotification"] = newVideo.IsOn;
bool[] notificationsSettings = new bool[] { (bool)settings.Values["newVideoNotification"], (bool)settings.Values["devNews"] };
await FileIO.WriteTextAsync(
await ApplicationData.Current.RoamingFolder.CreateFileAsync("notifications.json", CreationCollisionOption.ReplaceExisting),
JsonConvert.SerializeObject(notificationsSettings));
}
private void region_SelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -135,9 +140,13 @@ namespace FoxTube.Pages.SettingsPages
CoreApplication.Exit();
}
private void devNews_Toggled(object sender, RoutedEventArgs e)
private async void devNews_Toggled(object sender, RoutedEventArgs e)
{
settings.Values["devnews"] = devNews.IsOn;
bool[] notificationsSettings = new bool[] { (bool)settings.Values["newVideoNotification"], (bool)settings.Values["devNews"] };
await FileIO.WriteTextAsync(
await ApplicationData.Current.RoamingFolder.CreateFileAsync("notifications.json", CreationCollisionOption.ReplaceExisting),
JsonConvert.SerializeObject(notificationsSettings));
}
}
}