예제 #1
0
        /// <summary>
        /// Populates the page with content passed during navigation. Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>.
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session. The state will be null the first time a page is visited.</param>
        private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {

            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            if (localSettings.Values.ContainsKey("Email") && localSettings.Values.ContainsKey("Password"))
                VM.setEmailPwd(localSettings.Values["Email"].ToString(), localSettings.Values["Password"].ToString());
            else
                Frame.Navigate(typeof(StartUpPage));


            await VM.updateUsers();
            await VM.getFriendUsersAsync();
            setMyLocation();
            await VM.getLocations();

            var locator = new Geolocator();
            locator.DesiredAccuracyInMeters = 50;
            var pos = await locator.GetGeopositionAsync();
            await myMap.TrySetViewAsync(pos.Coordinate.Point, 16);
            mySlider.Value = myMap.ZoomLevel;

            /*
            timerUser.Interval = TimeSpan.FromSeconds(5);
            timerUser.Tick += async delegate
            {
                await VM.updateUsers();
                await VM.getFriendUsersAsync();
            };
            timerUser.Start();
            */

            /*
            timerLocations.Interval = TimeSpan.FromSeconds(60);
            timerLocations.Tick += async delegate
            {
                setMyLocation();
                await VM.getLocations();
            };
            */
        }
예제 #2
0
        /// <summary>
        /// Populates the page with content passed during navigation. Any saved state is also
        /// provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        /// The source of the event; typically <see cref="NavigationHelper"/>.
        /// </param>
        /// <param name="e">Event data that provides both the navigation parameter passed to
        /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
        /// a dictionary of state preserved by this page during an earlier
        /// session.  The state will be null the first time a page is visited.</param>
        private async void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
            if (localSettings.Values.ContainsKey("Email") && localSettings.Values.ContainsKey("Password"))
                VM.setEmailPwd(localSettings.Values["Email"].ToString(), localSettings.Values["Password"].ToString());
            else
                Frame.Navigate(typeof(StartUpPage));

            List<string> Data = e.NavigationParameter as List<string>;
            this.emailTo = Data[0];
            await VM.updateMessages(emailTo);
            TB_Name.Text = Data[1];
            timer.Start();
            
        }
예제 #3
0
 /// <summary>
 /// Populates the page with content passed during navigation.  Any saved state is also
 /// provided when recreating a page from a prior session.
 /// </summary>
 /// <param name="sender">
 /// The source of the event; typically <see cref="NavigationHelper"/>
 /// </param>
 /// <param name="e">Event data that provides both the navigation parameter passed to
 /// <see cref="Frame.Navigate(Type, Object)"/> when this page was initially requested and
 /// a dictionary of state preserved by this page during an earlier
 /// session.  The state will be null the first time a page is visited.</param>
 private void NavigationHelper_LoadState(object sender, LoadStateEventArgs e)
 {
 }