summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls/SimpleApp.cs
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@gmail.com>2016-03-29 14:08:26 -0600
committerE.Z. Hart <hartez@gmail.com>2016-03-29 14:08:26 -0600
commit81cb1d36479ec7d889fade1d53bef34357a73fb9 (patch)
tree061db1acff6446c4a7fce242c4231bb6e19e5a8a /Xamarin.Forms.Controls/SimpleApp.cs
parent57b0f3ab3080928d2ddd2da58fc84ef7023c3651 (diff)
downloadxamarin-forms-81cb1d36479ec7d889fade1d53bef34357a73fb9.tar.gz
xamarin-forms-81cb1d36479ec7d889fade1d53bef34357a73fb9.tar.bz2
xamarin-forms-81cb1d36479ec7d889fade1d53bef34357a73fb9.zip
Make ControlGallery App.cs conform to code style
Diffstat (limited to 'Xamarin.Forms.Controls/SimpleApp.cs')
-rw-r--r--Xamarin.Forms.Controls/SimpleApp.cs42
1 files changed, 42 insertions, 0 deletions
diff --git a/Xamarin.Forms.Controls/SimpleApp.cs b/Xamarin.Forms.Controls/SimpleApp.cs
new file mode 100644
index 00000000..aab454f7
--- /dev/null
+++ b/Xamarin.Forms.Controls/SimpleApp.cs
@@ -0,0 +1,42 @@
+using System.Diagnostics;
+
+namespace Xamarin.Forms.Controls
+{
+ public class SimpleApp : Application
+ {
+ public SimpleApp()
+ {
+ var label = new Label { VerticalOptions = LayoutOptions.CenterAndExpand };
+
+ if (Current.Properties.ContainsKey("LabelText"))
+ {
+ label.Text = (string)Current.Properties["LabelText"] + " Restored!";
+ Debug.WriteLine("Initialized");
+ }
+ else
+ {
+ Current.Properties["LabelText"] = "Wowza";
+ label.Text = (string)Current.Properties["LabelText"] + " Set!";
+ Debug.WriteLine("Saved");
+ }
+
+ MainPage = new ContentPage
+ {
+ Content = new StackLayout
+ {
+ Children =
+ {
+ label
+ }
+ }
+ };
+
+ SerializeProperties();
+ }
+
+ static async void SerializeProperties()
+ {
+ await Current.SavePropertiesAsync();
+ }
+ }
+} \ No newline at end of file