diff options
Diffstat (limited to 'Xamarin.Forms.Controls/SimpleApp.cs')
-rw-r--r-- | Xamarin.Forms.Controls/SimpleApp.cs | 42 |
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 0000000..aab454f --- /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 |