Inheritance: INavigationEventArgs
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     history = new HistoriesViewModel();
     histories = history.getHistory();
     //listViewHistory.Items.Add(histories);
     try
     {
         if (histories != null)
         {
             foreach (var hist in histories)
             {
                 listViewHistory.Items.Add(hist.ID + " :Used :" + hist.USED_UNITS + " Remained " + hist.REMAINING_UNITS + " DATE: " + hist.DATE + "");
             }
         }
         else
         {
             messageBox("No history in the database");
         }
     }
     catch (Exception ex)
     {
         messageBox("error " + ex.Message);
     }
     base.OnNavigatedTo(e);
 }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e != null)
     {
         this.PageParameter = e.Parameter;
     }
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            Frame rootFrame = Window.Current.Content as Frame;

            if (rootFrame.CanGoBack)
            {
                // If we have pages in our in-app backstack and have opted in to showing back, do so
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
            }
            else
            {
                // Remove the UI from the title bar if there are no pages in our in-app back stack
                SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed;
            }
            EmailTopics et = (EmailTopics)e.Parameter;
            toRecepients.Text = et.recipient_names;
            subjectTitle.Text = et.subject;
            //dateTime.Text = "Sent on " + String.Format("{0:f}", et.createdat);
            dateTime.Text = "Sent on " + et.updated_at;
            et.body_unstripped = Regex.Replace(et.body_unstripped, "Â", String.Empty);
            string nav = WrapHtml(et.body_unstripped, myWebView.ActualWidth, myWebView.ActualHeight);
            currentHTML = nav;
            myWebView.NavigateToString(nav);     
                   
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            _dataTransferManager = DataTransferManager.GetForCurrentView();
            _dataTransferManager.DataRequested += OnDataRequested;

            base.OnNavigatedTo(e);
        }
Exemple #5
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     TimeViewMama.Text = DateTime.Now.ToString("dd/MM/yyyy        hh:mm tt");
     MainPage.dispatcherTime.Tick += dispatcherTime_Tick;
     MainPage.dispatcherTime.Interval = new TimeSpan(0, 0, 30);
     MainPage.dispatcherTime.Start();
 }
Exemple #6
0
 protected override void OnNavigatedTo(NavigationEventArgs e) 
 {
     postInfo_list.ItemsSource = CommentList;
     pid = (int)e.Parameter;
     HttpRequestAsync(async () =>
     {
         string resourceAddress = postServer + pid;
         string responseBody;
         HttpResponseMessage response = await httpClient.GetAsync(new Uri(resourceAddress)).AsTask(cts.Token);
         responseBody = await response.Content.ReadAsStringAsync().AsTask(cts.Token);
         var serializer = new DataContractJsonSerializer(typeof(postInfo));   //将json字符串解析成class
         var mStream = new MemoryStream(Encoding.Unicode.GetBytes(responseBody));
         postinfo = (postInfo)serializer.ReadObject(mStream);
         init_post(postinfo.post);
         resourceAddress = commentServer + pid;
         response = await httpClient.GetAsync(new Uri(resourceAddress)).AsTask(cts.Token);
         responseBody = await response.Content.ReadAsStringAsync().AsTask(cts.Token);
         serializer = new DataContractJsonSerializer(typeof(floorInfo));   //将json字符串解析成class
         mStream = new MemoryStream(Encoding.Unicode.GetBytes(responseBody));
         floors = (floorInfo)serializer.ReadObject(mStream);
         init_comment(floors);
         return responseBody;
     });
     
 }
Exemple #7
0
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.  The Parameter
 /// property is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     // Preserve the app bar
     appBar = rootPage.BottomAppBar;
     // this ensures the app bar is not shown in this scenario
     rootPage.BottomAppBar = null;
 }
        protected override void OnNavigatedTo( NavigationEventArgs e )
        {
            base.OnNavigatedTo( e );
            Logger.Log( ID, string.Format( "OnNavigatedTo: {0}", e.SourcePageType.Name ), LogType.INFO );

            ViewFile( e.Parameter as StorageFile );
        }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     _args = e.Parameter as HistoryNavigationArgs;
     if(_args == null)
         ViewModelLocator.NavMgr.ResetMainBackNav();
     base.OnNavigatedTo(e);
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
			//These two methods will show info about the state of the navigation stacks
			//and also enable or disable buttons from the User Interface.
            ShowInfo();
            UpdateUI();
        }
Exemple #11
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.Items = new ObservableCollection<object>(PhotosDataSource.GetItems());
            this.ItemTemplate = Resources["Hero"] as DataTemplate;

            base.OnNavigatedTo(e);
        }
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.BottomAppBar.Opened += BottomAppBar_Opened;
            this.BottomAppBar.Closed += BottomAppBar_Closed;
            HideCommands.IsEnabled = true;

        }
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {

            //DateTime date = new DateTime();
            lblDisplayName.Text = DateTime.Now.ToString();

        }
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            this.navigationHelper.OnNavigatedTo(e);

            Windows.Storage.ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings;
            ViewModel.EmprestimoViewModel emprestimo = new ViewModel.EmprestimoViewModel();
            emprestimo.SelectedEmprestimo = new Model.Emprestimo();
            if (e.Parameter.GetType() == typeof(ViewModel.EmprestimoViewModel))
            {
                emprestimo = (ViewModel.EmprestimoViewModel)e.Parameter;
                roamingSettings.Values["Livro"] = emprestimo.SelectedEmprestimo.Livro.ID.Value;
            }
            else
            {
                if (roamingSettings.Values.ContainsKey("Livro"))
                {
                    var codigoLivro = Convert.ToInt32(roamingSettings.Values["Livro"].ToString());
                    emprestimo.SelectedEmprestimo.Livro = (new ViewModel.LivroViewModel()).ObterLivroPorCodigo(codigoLivro);
                }
                emprestimo.SelectedEmprestimo.Usuario = (Model.Usuario)e.Parameter;
            }

            if (emprestimo.SelectedEmprestimo.ID.HasValue)
                ButtonSalvar.IsEnabled = false;
            else
                ButtonSalvar.IsEnabled = true;

            this.DataContext = emprestimo;
        }
Exemple #15
0
        protected override async void OnNavigatedTo(NavigationEventArgs navArgs)
        {
            Debug.WriteLine("MainPage::OnNavigatedTo");

            byte adc = 0;
            for (int i = 0; i < 50; i++)
            {
                int readVal = await mcp3008.ReadADC(adc);

                // The raw voltage read
                float voltage = readVal * SourceVoltage;

                voltage /= MaxADCValue;

                // Remove the TMP36 .5v offset
                voltage -= VoltageOffset;


                Debug.WriteLine("Read value: " + readVal.ToString());
                var temperatureInC = voltage * 100;
                var temperatureInF = temperatureInC * 9 / 5 + 32;
                Debug.WriteLine(string.Format("V: {0} C: {1} F: {2}", voltage + VoltageOffset, temperatureInC, temperatureInF));
                await Task.Delay(100);
            }
        }
Exemple #16
0
 /// <summary>
 /// 在此页将要在 Frame 中显示时进行调用。
 /// </summary>
 /// <param name="e">描述如何访问此页的事件数据。
 /// 此参数通常用于配置页。</param>
 protected   override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (e.Parameter != null)
     {
         GetContact(e.Parameter .ToString ());
     }
 }
        /// <summary>
        /// When activating the scenario, ensure we have permission from the user to access their microphone, and
        /// provide an appropriate path for the user to enable access to the microphone if they haven't
        /// given explicit permission for it. 
        /// </summary>
        /// <param name="e">The navigation event details</param>
        protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            // Save the UI thread dispatcher to allow speech status messages to be shown on the UI.
            dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;

            bool permissionGained = await AudioCapturePermissions.RequestMicrophonePermission();
            if (permissionGained)
            {
                // Enable the recognition buttons.
                btnRecognizeWithUI.IsEnabled = true;
                btnRecognizeWithoutUI.IsEnabled = true;

                Language speechLanguage = SpeechRecognizer.SystemSpeechLanguage;
                string langTag = speechLanguage.LanguageTag;
                speechContext = ResourceContext.GetForCurrentView();
                speechContext.Languages = new string[] { langTag };

                speechResourceMap = ResourceManager.Current.MainResourceMap.GetSubtree("LocalizationSpeechResources");

                PopulateLanguageDropdown();
                await InitializeRecognizer(SpeechRecognizer.SystemSpeechLanguage);
            }
            else
            {
                resultTextBlock.Visibility = Visibility.Visible;
                resultTextBlock.Text = "Permission to access capture resources was not given by the user; please set the application setting in Settings->Privacy->Microphone.";
                btnRecognizeWithUI.IsEnabled = false;
                btnRecognizeWithoutUI.IsEnabled = false;
                cbLanguageSelection.IsEnabled = false;
            }
        }
 protected override void OnNavigatedTo(NavigationEventArgs e) {
     if (accounts == null) {
         lvAccounts.Visibility = Visibility.Collapsed;
         spLVHeader.Visibility = Visibility.Collapsed;
         spCreateNewAccount.Visibility = Visibility.Visible;
     }
 }
Exemple #19
0
 protected async override void OnNavigatedTo(NavigationEventArgs e)
 {
     InboxClient client = new InboxClient("http://inboxdev.cloudapp.net:5555/");
     Namespace ns = await client.GetFirstNamespace();
     client.Namespace = ns.Namespace_ID;
     List<Tag> tags = new List<Tag>(await client.GetTags());
     //Tag tag = await client.NewCustomTag("TestInboxApp");
     //Tag tag = await client.GetTag("InboxApp");
     //Tag tag = tags.Where(t => t.Name == "TestInboxApp").First();
     //Tag tag2 = await client.RenameCustomTag(tag.ID, "Other Test");
     //List<Thread> threads = new List<Thread>(await client.GetThreads(tag: CanonicalTags.Inbox));
     //string[] add_tags = { tag.Name };
     //string[] remove_tags = { threads[0].Tags[0].Name };
     //await client.UpdateThreadTags(threads[0].ID, "test", "test2");
     IEnumerable<Message> messages = await client.GetMessages(tag: CanonicalTags.Inbox, limit: 5);
     Message message = null;
     Message mess = messages.First();
     if (mess.Unread)
     {
         message = await client.MarkMessageAsRead(mess.ID);
     }
     else
     {
         message = await client.MarkMessageAsUnread(mess.ID);
     }
 }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     var data = e.Parameter as string[];
     uid = data[0];
     rid = data[1];
     LoadData();
 }
Exemple #21
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var navigableViewModel = this.DataContext as INavigable;
            navigableViewModel?.Activate(e.Parameter, e.NavigationMode);
        }
Exemple #22
0
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            if(e.Parameter != null)
            {
                //we got any parameter, insert it into the textfield
                if (MainPage.position > -1)
                {
                    //split string into [0,pos] and [pos+1,end]
                    // var firstpart = MainPage.code.Substring(0, MainPage.position);
                    //var secondpart = MainPage.code.Substring(MainPage.position, MainPage.code.Length - firstpart.Length);
                    //this.textBox.Document.SetText(Windows.UI.Text.TextSetOptions.ApplyRtfDocumentDefaults, firstpart + e.Parameter as string + secondpart);
                    this.textBox.Document.SetText(Windows.UI.Text.TextSetOptions.ApplyRtfDocumentDefaults, MainPage.code);
                    //this.textBox.Document.Selection.SetIndex(Windows.UI.Text.TextRangeUnit.Character, MainPage.position, false);
                    this.textBox.Document.Selection.SetRange(MainPage.position, MainPage.position);
                    this.textBox.Document.Selection.Text = e.Parameter as String + "\n";

                }
                else
                {
                    this.textBox.Document.SetText(Windows.UI.Text.TextSetOptions.ApplyRtfDocumentDefaults, MainPage.code + e.Parameter as string + "\n");
                }

            }
        }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            ScrollViewer.SetVerticalScrollMode(CategoryPageGridView, ScrollMode.Disabled);
            CategoryPageViewModel categoryPageViewModel =
                           (CategoryPageViewModel)Resources["CategoryPageViewModel"];
            NavigationItem navigationItem = e.Parameter as NavigationItem;
            var task = Task.Factory.StartNew(async () =>
            {
                var bundle = await DownloadNavigationItem(navigationItem.ReferralId);
                var navigationItems = await DownloadNavigationItemsAsync();

                await CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.High,
                    () =>
                    {
                        categoryPageViewModel.Content = bundle.Content[0];
                        var items =  new List<Content>(bundle.Content);
                        items.RemoveAt(0);
                        bundle.Content = items.ToArray();
                        categoryPageViewModel.Bundle = bundle;
                        categoryPageViewModel.NavigationItems = navigationItems;
                        LoadingGrid.Visibility = Visibility.Collapsed;
                        MySplitView.Visibility = Visibility.Visible;
                    }
                );
            });
            base.OnNavigatedTo(e);
        }
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.  The Parameter
 /// property is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     CompositionTarget.SurfaceContentsLost += CompositionTarget_SurfaceContentsLost;
     DisplayInformation.GetForCurrentView().DpiChanged += OnDpiChanged;
     rootPage.MainPageResized += rootPage_MainPageResized;
     UpdateOutputLayout();
 }
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     //HardwareButtons.BackPressed += HardwareButtons_BackPressed;//注册重写后退按钮事件
     uIdListView.ItemsSource = App.muIdList;
     MorePage.isFreeRe = 0;
     UmengSDK.UmengAnalytics.TrackPageStart("SearchFreeTime");
 }
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            Sqlite sqlData = new Sqlite();
            var plan = (Plans)e.Parameter;
            Days d;

            //startDate.Text = "From " + plan.StartDate.Date.ToString("d", DateTimeFormatInfo.InvariantInfo) + " To " + plan.EndDate.Date.ToString("d", DateTimeFormatInfo.InvariantInfo);
            startDate.Text = "From " + plan.StartDate.ToString("dd/MM/yyyy") + " To " + plan.EndDate.ToString("dd/MM/yyyy");
            location.Text = "in " + plan.Location;
            maxDay.Text = plan.MaxDay.ToString();
            if (plan.MaxDay == 0)
            {
                addNewEvent.IsEnabled = false;
            }
            //DaysList = DayList.getDayList(plan.StartDate, plan.EndDate);

            // Initialize date instance
            var queryDay = from pd in sqlData.conn.Table<Days>()
                           where pd.PlanID_FK.Equals(plan.PlanID)
                           select pd;

            // create date if there is no date
            if (queryDay.Count<Days>() == 0)
            {
                for (int i = 1; i <= Convert.ToInt16(maxDay.Text); i++)
                {
                    d = new Days(plan.PlanID, "No Activities on this day!", "Day " + i.ToString());
                    sqlData.conn.Insert(d);
                }
            }
            DaysList = DayList.getDayList(plan);
        }
Exemple #27
0
        protected override void OnNavigatedFrom(NavigationEventArgs e)
        {
            base.OnNavigatedFrom(e);

            var navigableViewModel = this.DataContext as INavigable;
            navigableViewModel?.Deactivated(e.Parameter);
        }
Exemple #28
0
        /// <summary>
        /// 在此页将要在 Frame 中显示时进行调用。
        /// </summary>
        /// <param name="e">描述如何访问此页的事件数据。
        /// 此参数通常用于配置页。</param>
        async protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            EditAppbar.Visibility = Windows.UI.Xaml.Visibility.Visible;
            AddAppbar.Visibility = Windows.UI.Xaml.Visibility.Visible;
            FindAppbar.Visibility = Windows.UI.Xaml.Visibility.Visible;
            DeleteAppbar.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            //if (e.Parameter != null)
            //{
            //    cityname.city = e.Parameter.ToString();
            //    cityName.Add(cityname);
                
            //}
            //colCityName.ItemsSource = cityName;
            
             Files.Items.Clear();
            //创建文件夹
            StorageFolder storage = await ApplicationData.Current.LocalFolder.CreateFolderAsync("CityList", CreationCollisionOption.OpenIfExists);
            //获取当前文件夹中的文件
            var files = await storage.GetFilesAsync();
            //便利 每一个文件
            foreach (StorageFile file in files)
            {
                XmlDocument doc=await XmlDocument.LoadFromFileAsync (file );
                //cityname.city = doc.DocumentElement.Attributes.GetNamedItem ("city").NodeValue.ToString ();
                cityname = new Citys();
                cityname.city = file.DisplayName;
                if (cityname.city == "City")
                    continue;
                else
                    cityName.Add(cityname);

            }
            Files.ItemsSource = cityName;
        }
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// 
        /// Create the DeviceWatcher objects when the user navigates to this page so the UI list of devices is populated.
        /// </summary>
        /// <param name="eventArgs">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs eventArgs)
        {
            // If we are connected to the device or planning to reconnect, we should disable the list of devices
            // to prevent the user from opening a device without explicitly closing or disabling the auto reconnect
            if (EventHandlerForDevice.Current.IsDeviceConnected
                || (EventHandlerForDevice.Current.IsEnabledAutoReconnect
                && EventHandlerForDevice.Current.DeviceInformation != null))
            {
                UpdateConnectDisconnectButtonsAndList(false);

                // These notifications will occur if we are waiting to reconnect to device when we start the page
                EventHandlerForDevice.Current.OnDeviceConnected = this.OnDeviceConnected;
                EventHandlerForDevice.Current.OnDeviceClose = this.OnDeviceClosing;
            }
            else
            {
                UpdateConnectDisconnectButtonsAndList(true);
            }

            // Begin watching out for events
            StartHandlingAppEvents();

            // Initialize the desired device watchers so that we can watch for when devices are connected/removed
            InitializeDeviceWatchers();
            StartDeviceWatchers();

            DeviceListSource.Source = listOfDevices;
        }
Exemple #30
0
        protected   async override void OnNavigatedTo(NavigationEventArgs e)
        {
            BindingSensorData data;
            base.OnNavigatedTo(e);
            current_vwSiteDegree = e.Parameter as vwSiteDegree;
            this.DefaultViewModel["Group"] = data = await GenerateBindingData(current_vwSiteDegree);
            this.MapControls.ItemsSource = data.Items;
            this.cctvControls.ItemsSource = data.cctvs;
            foreach (tblCCTV cctv in data.cctvs)
            {
                Controls.CCTV cctvctl = new Controls.CCTV() { DataContext = cctv };

                cctvctl.Margin = new Thickness(0);
                cctvctl.Width = 300;
                cctvctl.VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Stretch;
                cctvctl.Tapped += cctvctl_Tapped;
                
                this.stkCCTV.Children.Add(cctvctl);
            }
           // tmp.DataContext = data.Items.FirstOrDefault(n => n.CURRENT_DEGREE == 3);
            this.map.SetView(new Bing.Maps.Location() { Longitude = data.X, Latitude = data.Y }, 19);
            tmr.Interval = TimeSpan.FromSeconds(60);
            tmr.Tick += tmr_Tick;
            tmr.Start();
        
        }
Exemple #31
0
        void FacadeNavigatedEventHandler(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            CurrentPageType  = e.SourcePageType;
            CurrentPageParam = e.Parameter;
            var args = new NavigatedEventArgs(e, Content as Page);

            foreach (var handler in _navigatedEventHandlers)
            {
                handler(this, args);
            }
        }
Exemple #32
0
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            NavigationHelper.ActivePage = this.GetType();
            base.OnNavigatedTo(e);
            if (e.NavigationMode == NavigationMode.New)
            {
                Initialize();
            }

            UmengSDK.UmengAnalytics.TrackPageStart(this.GetType().ToString());
        }
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            dtm = DataTransferManager.GetForCurrentView();

            if (dtm != null)
            {
                dtm.DataRequested += dtm_DataRequested;
            }
        }
 protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     if (dd != null)
     {
         dd.Hide();
     }
     if (contentDialog != null)
     {
         contentDialog.Hide();
     }
 }
 protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     if (sp != null)
     {
         sp.Hide();
     }
     if (moreInfo != null)
     {
         moreInfo.Hide();
     }
 }
Exemple #36
0
 void FacadeNavigatedEventHandler(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     foreach (var handler in _navigatedEventHandlers)
     {
         var args = new NavigationEventArgs()
         {
             NavigationMode = e.NavigationMode,
             Parameter      = (e.Parameter == null) ? string.Empty : e.Parameter.ToString()
         };
         handler(this, args);
     }
 }
Exemple #37
0
 override protected void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
     displayOrientation = ApplicationView.GetForCurrentView().Orientation;
     displayInformation = DisplayInformation.GetForCurrentView();
     deviceOrientation  = SimpleOrientation.NotRotated;
     orientationSensor  = SimpleOrientationSensor.GetDefault();
     if (orientationSensor != null)
     {
         deviceOrientation = orientationSensor.GetCurrentOrientation();
         orientationSensor.OrientationChanged += OrientationSensor_OrientationChanged;
     }
     Window.Current.SizeChanged += Current_SizeChanged;
 }
Exemple #38
0
 private void FacadeNavigatedEventHandler(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     foreach (var handler in _navigatedEventHandlers)
     {
         var args = new NavigationEventArgs
         {
             NavigationMode = e.NavigationMode,
             Parameter      = e.Parameter == null ? string.Empty : e.Parameter.ToString()
         };
         handler(this, args);
     }
     CurrentPageType  = e.SourcePageType;
     CurrentPageParam = e.Parameter as string;
 }
 void FacadeNavigatedEventHandler(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     foreach (var handler in _navigatedEventHandlers)
     {
         var args = new NavigationEventArgs()
         {
             NavigationMode = e.NavigationMode,
             Parameter      = e.Parameter?.ToString()
         };
         handler(this, args);
     }
     this.CurrentPageType  = e.SourcePageType;
     this.CurrentPageParam = e.Parameter?.ToString();
 }
Exemple #40
0
        protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            if (e.NavigationMode == NavigationMode.Back)
            {
                this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Disabled;
            }
            else
            {
                this.NavigationCacheMode = Windows.UI.Xaml.Navigation.NavigationCacheMode.Required;
            }

            base.OnNavigatedFrom(e);

            UmengSDK.UmengAnalytics.TrackPageEnd(this.GetType().ToString());
        }
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var frameState = SuspensionManager.SessionStateForFrame(this.Frame);

            this._pageKey = "Page-" + this.Frame.BackStackDepth;

            if (e.NavigationMode == NavigationMode.New)
            {
                // Clear existing state for forward navigation when adding a new page to the
                // navigation stack
                var nextPageKey   = this._pageKey;
                int nextPageIndex = this.Frame.BackStackDepth;
                while (frameState.Remove(nextPageKey))
                {
                    nextPageIndex++;
                    nextPageKey = "Page-" + nextPageIndex;
                }

                // Pass the navigation parameter to the new page
                if (this.LoadState != null)
                {
                    this.LoadState(this, new LoadStateEventArgs(e.Parameter, null));
                }
            }
            else
            {
                // Pass the navigation parameter and preserved page state to the page, using
                // the same strategy for loading suspended state and recreating pages discarded
                // from cache
                if (this.LoadState != null)
                {
                    this.LoadState(this, new LoadStateEventArgs(e.Parameter, (Dictionary <String, Object>)frameState[this._pageKey]));
                }
            }


            currentView = SystemNavigationManager.GetForCurrentView();

            if (!ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                currentView.AppViewBackButtonVisibility = this.Frame.CanGoBack ? AppViewBackButtonVisibility.Visible : AppViewBackButtonVisibility.Collapsed;
            }


            currentView.BackRequested += SystemNavigationManager_BackRequested;
        }
Exemple #42
0
        void FacadeNavigatedEventHandler(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            CurrentPageType  = e.SourcePageType;
            CurrentPageParam = ParameterSerializationService.Instance.DeserializeParameter(e.Parameter);
            var args = new NavigatedEventArgs(e, Content as Page);

            if (NavigationModeHint != NavigationMode.New)
            {
                args.NavigationMode = NavigationModeHint;
            }
            NavigationModeHint = NavigationMode.New;
            foreach (var handler in _navigatedEventHandlers)
            {
                handler(this, args);
            }
        }
Exemple #43
0
        private void Frame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            //Set listView selection and prevent event benn triggered
            listView.SelectionChanged -= ListView_SelectionChanged;
            if (e.SourcePageType == typeof(CurriculumPage))
            {
                listView.SelectedItem = CurriculumListViewItem;
            }
            else if (e.SourcePageType == typeof(SchedulePage))
            {
                listView.SelectedItem = ScheduleListViewItem;
            }
            else if (e.SourcePageType == typeof(MidAlertPage))
            {
                listView.SelectedItem = MidAlertListViewItem;
            }
            else if (e.SourcePageType == typeof(AttendenceAndHonorsPage))
            {
                listView.SelectedItem = AttendenceAndHonorsListViewItem;
            }
            else if (e.SourcePageType == typeof(CreditsPage))
            {
                listView.SelectedItem = CreditsListViewItem;
            }
            else if (e.SourcePageType == typeof(PortalPage))
            {
                listView.SelectedItem = PortalListViewItem;
            }
            else
            {
                listView.SelectedItem = null;
            }
            listView.SelectionChanged += ListView_SelectionChanged;

            //Set navigate back visibility

            foreach (PageStackEntry entry in frame.BackStack)
            {
                if (entry.SourcePageType == typeof(LoginPage))
                {
                    frame.BackStack.Remove(entry);
                }
            }

            navigateBackButton.Visibility = frame.CanGoBack ? Visibility.Visible : Visibility.Collapsed;
        }
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            var app = e.Parameter as Xamarin.Forms.Application;

            LoadApplication(app);
            Windows.UI.Core.SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility =
                Windows.UI.Core.AppViewBackButtonVisibility.Visible;
            Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += MainPage_BackRequested;
            ApplicationView appView = ApplicationView.GetForCurrentView();
            string          title   = app.MainPage.Title;

            if (string.IsNullOrEmpty(title))
            {
                title = app.GetType().Namespace;
            }
            appView.Title = title;
            base.OnNavigatedTo(e);
        }
Exemple #45
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);
            var streamService = App.Current.Kernel.Resolve <ITorrentStreamService>();

            if (streamService.StreamManager == null ||
                streamService.StreamManager.CurrentState != TorrentStreamManager.State.Streaming)
            {
                Dispose();
                return;
            }

            var torrentFile = streamService.StreamManager.TorrentVideoFile;
            var storageFile = await StorageHelper.GetFileAsync(torrentFile.Path, torrentFile.TargetFolder);

            MediaElement.SetSource(
                new TorrentRandomAccessStream(streamService.StreamManager), storageFile.ContentType);
        }
Exemple #46
0
        private void contentFrame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            if (e.Parameter != null)
            {
                Title.Text = e.Parameter as string;
            }
            else
            {
                Title.Text = "Home";
            }

            if (this.contentFrame.CanGoBack)
            {
                backButton.IsEnabled = true;
            }
            else
            {
                backButton.IsEnabled = false;
            }
        }
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var parameters = (object[])e.Parameter;

            groups = (List <StiReportData.StiGroupInfoList>)parameters[0];
            var group = (StiReportData.StiGroupInfoList)parameters[1];

            cvs1.Source = group;

            this.textBlockKey.Text  = group.Key;
            this.textBlockDesc.Text = group.Desc;

            if (StiDemoReportsPage.NavigatorReportsType != ReportsType.Demo)
            {
                return;
            }

            buttonRemove.Visibility    = Visibility.Collapsed;
            buttonAddReport.Visibility = Visibility.Collapsed;
        }
        protected async override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            var parameters = (object[])e.Parameter;

            // Groups
            groups = parameters[0] as List <StiReportData.StiGroupInfoList> ??
                     await StiReportData.GetReportsByCategoryAsync("CustomReports\\Reports.xml", true);

            // Report
            currentReport = parameters[1] as StiReport;
            if (currentReport == null)
            {
                radioCurrentReport.IsEnabled = false;
                radioNewDocument.IsChecked   = true;
            }
            else
            {
                radioCurrentReport.IsChecked = true;
            }

            if (groups.Count > 0)
            {
                foreach (var group in groups)
                {
                    comboBoxCategory.Items.Add(group.Key);
                }

                comboBoxCategory.SelectedIndex = 0;
                radioCurrentCategory.IsChecked = true;
            }
            else
            {
                radioNewCategory.IsChecked     = true;
                radioCurrentCategory.IsEnabled = false;
            }
        }
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            if (e.Parameter is FingerSensorsApp.App)
            {
                FingerSensorsApp.App AppEnvironment = e.Parameter as FingerSensorsApp.App;


                if (AppEnvironment != null)
                {
                    m_Environment               = AppEnvironment.Environment;
                    m_DataSets                  = m_Environment.SEN0188SQLite.DataSets;
                    m_SEN0188SQLite             = m_Environment.SEN0188SQLite;
                    m_Connector_SEN0188         = m_Environment.SensorConnector;
                    m_Sensoroutputconfigoptions = m_Environment.SensorOutPutServiceConnectorConfig;
                    m_Sensorinputconfigoptions  = m_Environment.SensorInputServiceConnectorConfig;
                    m_SEN0188SQLite.GetDataSets();

                    m_serDev           = m_Environment.SerDev;
                    SensorIDValue.Text = "not set";
                    m_Connector_SEN0188.NotifyChangeState += Connector_SEN0188_NotifyChangeState;
                }
            }
            base.OnNavigatedTo(e);
        }
Exemple #50
0
 protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     SensorTagPanel.Hide();
 }
 private void ItemFrame_Navigated(object sender, Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     // Cache a reference to the currently displayed item frame.  Note that
     // this will be a different frame instance per pivot item.
     _currentItemFrame = (Frame)sender;
 }
Exemple #52
0
 protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedTo(e);
 }
Exemple #53
0
 protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     Window.Current.SizeChanged -= try_resize_.OnWindowSizeChanged;
 }
Exemple #54
0
        protected async override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            await FillDataAsync();
        }
Exemple #55
0
 private void OnFrameNavigated(object sender, Navigation.NavigationEventArgs e)
 {
     _currentView.AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
 }
 protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     base.OnNavigatedFrom(e);
     ViewModel.HideBlocksOpened -= ViewModelOnHideBlocksOpened;
     ViewModel.HideBlocksClosed -= ViewModelOnHideBlocksClosed;
 }
 protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     vm = ((MainPageViewModel)this.DataContext);
     base.OnNavigatedTo(e);
     RegisterBackgroundTask();
 }
Exemple #58
0
 protected override async void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     var   btTask = btHelper.Disconnect();
     await btTask;
 }
Exemple #59
0
        protected override void OnNavigatedTo(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            this.OnViewCreate(e.Parameter as MvxViewModelRequest, () => this.LoadStateBundle(e));
        }
 protected override void OnNavigatedFrom(Windows.UI.Xaml.Navigation.NavigationEventArgs e)
 {
     HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
     base.OnNavigatedFrom(e);
 }