示例#1
0
        public SettingsPage()
        {
            this.InitializeComponent();

            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;

            // check currently selected unit
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            string dUnit;

            if (localSettings.Values.ContainsKey("DisplayUnit"))
            {
                dUnit = (string)localSettings.Values["DisplayUnit"];
            }
            else
            {
                localSettings.Values["DisplayUnit"] = "METERS";
                dUnit = "METERS";
            }

            if (dUnit == "METERS")
            {
                radiobtn_meters.IsChecked = true;
            }
            else if (dUnit == "FEET")
            {
                radiobtn_feet.IsChecked = true;
            }
            else if (dUnit == "METERES_AND_FEET")
            {
                radiobtn_meters_and_feet.IsChecked = true;
            }
        }
示例#2
0
        public AboutPage()
        {
            this.InitializeComponent();

            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;
            string appVersion = string.Format(" {0}.{1}.{2}.{3}",
                                        Windows.ApplicationModel.Package.Current.Id.Version.Major,
                                        Windows.ApplicationModel.Package.Current.Id.Version.Minor,
                                        Windows.ApplicationModel.Package.Current.Id.Version.Build,
                                        Windows.ApplicationModel.Package.Current.Id.Version.Revision);
            versionNr.Text = appVersion;
            message_body = "Feedback on Disctape version" + appVersion + ":";
        }
示例#3
0
        public MainPage()
        {
            this.InitializeComponent();

            this.navigationHelper = new NavigationHelper(this);
            this.navigationHelper.LoadState += this.NavigationHelper_LoadState;
            this.navigationHelper.SaveState += this.NavigationHelper_SaveState;

            //check display unit from localSettings, if not set, set it to meters
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;

            if (!localSettings.Values.ContainsKey("DisplayUnit"))
            {
                localSettings.Values["DisplayUnit"] = "METERS";
            }

            //connect label size change to its handler
            resultLbl_m.SizeChanged += resultLbl_SizeChanged;
            resultLbl_ft.SizeChanged += resultLbl_SizeChanged;

            
        }