From c8c0a222a0c630acec216c4c9cc56f9fa8df111b Mon Sep 17 00:00:00 2001 From: Baptiste ARNAUD Date: Fri, 22 Nov 2019 16:20:01 +0100 Subject: [PATCH] Deser power --- .../Resources/Resource.designer.cs | 8 ++--- TheGameExtreme/view/Settings.xaml.cs | 31 ++++++++++++------- 2 files changed, 24 insertions(+), 15 deletions(-) diff --git a/TheGameExtreme.Android/Resources/Resource.designer.cs b/TheGameExtreme.Android/Resources/Resource.designer.cs index 884c56f..455e66d 100644 --- a/TheGameExtreme.Android/Resources/Resource.designer.cs +++ b/TheGameExtreme.Android/Resources/Resource.designer.cs @@ -1,11 +1,11 @@ #pragma warning disable 1591 //------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// Ce code a été généré par un outil. +// Version du runtime :4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si +// le code est régénéré. // //------------------------------------------------------------------------------ diff --git a/TheGameExtreme/view/Settings.xaml.cs b/TheGameExtreme/view/Settings.xaml.cs index 95fc16a..a986b9b 100644 --- a/TheGameExtreme/view/Settings.xaml.cs +++ b/TheGameExtreme/view/Settings.xaml.cs @@ -1,31 +1,34 @@ using System; using System.Collections.Generic; - +using System.IO; +using System.Text; +using System.Xml; +using System.Xml.Serialization; using Xamarin.Forms; namespace TheGameExtreme.view { - public partial class Settings : ContentPage + [Serializable] + public partial class Settings : ContentPage { - + private bool bSwitchSerialisation; public Settings() - { + { InitializeComponent(); + NavigationPage.SetHasNavigationBar(this, false); if(pageContentSetting.BackgroundColor == Color.Black) - { + { swTheme.IsToggled = false; + bSwitchSerialisation = swTheme.IsToggled; } else { swTheme.IsToggled = true; + bSwitchSerialisation = swTheme.IsToggled; } - - - - } private void CBBr_CheckedChanged(object sender, CheckedChangedEventArgs e) @@ -68,7 +71,6 @@ namespace TheGameExtreme.view Application.Current.Resources["WhiteColor"] = Color.White; Application.Current.Resources["SkyBlueColor"] = Color.SkyBlue; - } else { @@ -76,10 +78,17 @@ namespace TheGameExtreme.view Application.Current.Resources["WhiteColor"] = Color.Black; Application.Current.Resources["BlueSkyColor"] = Color.SkyBlue; } - } + } + + private async void SettingToHomePage(object sender, EventArgs e) { + string path = @"\Documents\theme.txt"; + FileStream fs = File.Create(path); + byte[] info = new UTF8Encoding(true).GetBytes(bSwitchSerialisation.ToString()); + fs.Write(info, 0, info.Length); + await Navigation.PopAsync(); } }