Deser power

master
Baptiste ARNAUD 5 years ago
parent db317ada46
commit c8c0a222a0

@ -1,11 +1,11 @@
#pragma warning disable 1591 #pragma warning disable 1591
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // Ce code a été généré par un outil.
// Runtime Version:4.0.30319.42000 // Version du runtime :4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
// the code is regenerated. // le code est régénéré.
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

@ -1,31 +1,34 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Xml;
using System.Xml.Serialization;
using Xamarin.Forms; using Xamarin.Forms;
namespace TheGameExtreme.view namespace TheGameExtreme.view
{ {
public partial class Settings : ContentPage [Serializable]
public partial class Settings : ContentPage
{ {
private bool bSwitchSerialisation;
public Settings() public Settings()
{ {
InitializeComponent(); InitializeComponent();
NavigationPage.SetHasNavigationBar(this, false); NavigationPage.SetHasNavigationBar(this, false);
if(pageContentSetting.BackgroundColor == Color.Black) if(pageContentSetting.BackgroundColor == Color.Black)
{ {
swTheme.IsToggled = false; swTheme.IsToggled = false;
bSwitchSerialisation = swTheme.IsToggled;
} }
else else
{ {
swTheme.IsToggled = true; swTheme.IsToggled = true;
bSwitchSerialisation = swTheme.IsToggled;
} }
} }
private void CBBr_CheckedChanged(object sender, CheckedChangedEventArgs e) private void CBBr_CheckedChanged(object sender, CheckedChangedEventArgs e)
@ -68,7 +71,6 @@ namespace TheGameExtreme.view
Application.Current.Resources["WhiteColor"] = Color.White; Application.Current.Resources["WhiteColor"] = Color.White;
Application.Current.Resources["SkyBlueColor"] = Color.SkyBlue; Application.Current.Resources["SkyBlueColor"] = Color.SkyBlue;
} }
else else
{ {
@ -76,10 +78,17 @@ namespace TheGameExtreme.view
Application.Current.Resources["WhiteColor"] = Color.Black; Application.Current.Resources["WhiteColor"] = Color.Black;
Application.Current.Resources["BlueSkyColor"] = Color.SkyBlue; Application.Current.Resources["BlueSkyColor"] = Color.SkyBlue;
} }
} }
private async void SettingToHomePage(object sender, EventArgs e) 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(); await Navigation.PopAsync();
} }
} }

Loading…
Cancel
Save