private void AddGesturePage_Loaded(object sender, RoutedEventArgs e) { this.displayName = NavigationContext.QueryString["Name"]; this.displayNumber = NavigationContext.QueryString["Number"]; // if the passing string contains + in the beginning navigation context // is replacing with whitespace " " //removing whitespace and adding "+" int index = displayNumber.IndexOf(" ", 0, displayNumber.Length); if (index == 0) { this.displayNumber = "+" + displayNumber.TrimStart(); } gestureToBeEdited = null; if (NavigationContext.QueryString.Keys.Contains("Gesture")) { gestureToBeEdited = NavigationContext.QueryString["Gesture"]; } this.textToDisplay.Text = "Select a gesture for\n" + this.displayName + "\nby tilting the phone"; gestureControl.startAccelerometer(); }
void OnUnobscured(object sender, EventArgs e) { gestureControl.startAccelerometer(); // Microsoft.Phone.Applications.Common.AccelerometerHelper.Instance.Active = true; }