예제 #1
0
        protected override void LoadState(Object navigationParameter, Dictionary <String, Object> pageState)
        {
            var dataTransferManager = DataTransferManager.GetForCurrentView();

            dataTransferManager.DataRequested += DataTransferManager_DataRequested;

            if (pageState != null && pageState.ContainsKey(Constants.DocumentDetailPageState))
            {
                string serializedState = pageState[Constants.DocumentDetailPageState].ToString();
                var    state           = SerializationHelper.DeserializeFromString <DocumentDetailPageState>(serializedState);

                ViewModel.LoadState(state);
            }

            var navParam = DocumentDetailNavigationParameter.FromNavigationParameter((string)navigationParameter);

            ViewModel.NavigationParameter = navParam;

            if (navParam.Action == NavigationAction.LoadFromUrl)
            {
                ViewModel.PageTitle = navParam.DokumentTitel;
                webView.Navigate(new Uri(navParam.Command));
            }
            else
            {
                ViewModel.Load();
            }
        }
예제 #2
0
        private void Downloads_OnItemClick(object sender, ItemClickEventArgs e)
        {
            var item = e.ClickedItem as DbDownloadedDocument;

            var action = DocumentDetailNavigationParameter
                         .CreateNavigationParameter(item.DokumentTitel, NavigationAction.LoadCachedDownload, item.Id.ToString());

            NavigationService.Navigate <DocumentDetailPage>(action);
        }
예제 #3
0
        private void NavigateWithServiceAction(DocumentReference item)
        {
            var title = CreateTitleFromItem(item);

            var action = DocumentDetailNavigationParameter
                         .CreateNavigationParameter(title, NavigationAction.LoadFromService, item.Dokumentnummer);

            NavigationService.Navigate <DocumentDetailPage>(action);
        }
예제 #4
0
        //
        // http://tozon.info/blog/post/2011/10/06/Windows-8-Metro-declarations-Protocol.aspx
        //
        private async void OnProtocolActivated(ProtocolActivatedEventArgs args)
        {
            // Format:  risdok://NOR12110323
            string dokumentNummer = args.Uri.Host;
            string title          = "Dokument " + dokumentNummer;

            var action = DocumentDetailNavigationParameter
                         .CreateNavigationParameter(title, NavigationAction.LoadFromService, dokumentNummer);

            await CommonInitialize();
            await EnsureRootFrameInitialization(args.PreviousExecutionState, Window.Current.Content as Frame);

            NavigationService.Navigate <DocumentDetailPage>(action);
            Window.Current.Activate();
        }