Exemplo n.º 1
0
        private async Task Init()
        {
            PerfProgBar.IsIndeterminate = true;
            await fm.ReadFromFileAsync();

            await myFavoriter.ReadFromFileAsync();

            await nm.ReadFromFileAsync();

            RefreshData();
            PerfProgBar.IsIndeterminate = false;

            if (this.NavigationContext.QueryString.ContainsKey("ID"))
            {
                string ID = this.NavigationContext.QueryString["ID"].ToString();
                this.NavigationContext.QueryString.Remove("ID");

                var ld = fm.Items.Where(x => x.id == ID).ToList();
                if (ld.Count > 0)
                {
                    SystemSettingManager <Session> ssm = new SystemSettingManager <Session>("SelectData");
                    ssm.Item = ld[0];
                    await ssm.WriteToFileAsync();

                    NavigationService.Navigate(new Uri(MainHelp.PageNameDetailInformation, UriKind.Relative));
                }
            }
        }
Exemplo n.º 2
0
        private async void StackPanel_Tap(object sender, System.Windows.Input.GestureEventArgs e)
        {
            var           ee  = sender as StackPanel;
            ItemViewModel ivm = ee.Tag as ItemViewModel;

            if (ivm.DocID == "time")
            {
                return;
            }

            var ld = fm.Items.Where(x => x.id == ivm.DocID).ToList();

            if (ld.Count == 0)
            {
                MainHelp.toastMessage("錯誤訊息", string.Format("沒有發現該筆資料:{0}", ivm.DocID));
                return;
            }

            SystemSettingManager <Session> ssm = new SystemSettingManager <Session>("SelectData");

            ssm.Item = ld[0];
            await ssm.WriteToFileAsync();

            NavigationService.Navigate(new Uri(MainHelp.PageNameDetailInformation, UriKind.Relative));
        }