Ejemplo n.º 1
0
        protected LFDetailPageViewModel JsonToObject(string Json)
        {
            var LFDetailViewMode = new LFDetailPageViewModel();

            LFDetailViewMode = JsonConvert.DeserializeObject <LFDetailPageViewModel>(Json);
            return(LFDetailViewMode);
        }
Ejemplo n.º 2
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            var temp = e.Parameter as string;

            VM = await Model.GetDetail(temp);

            SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible;
            SystemNavigationManager.GetForCurrentView().BackRequested += PageBackRequested;
        }
Ejemplo n.º 3
0
        public async Task <LFDetailPageViewModel> GetDetail(string id)
        {
            LFDetailPageViewModel LFDPVM = new LFDetailPageViewModel();
            string content = await GetJson("http://hongyan.cqupt.edu.cn/laf/api/detail/" + id);

            if (content != "NetworkError")
            {
                LFDPVM = JsonToObject(content);
                if (LFDPVM.wx_avatar != "")
                {
                    if (LFDPVM.wx_avatar[0] == '/')
                    {
                        LFDPVM.HeadImg.UriSource = new Uri("http://hongyan.cqupt.edu.cn" + LFDPVM.wx_avatar);
                    }
                    else
                    {
                        LFDPVM.HeadImg.UriSource = new Uri(LFDPVM.wx_avatar);
                    }
                }
            }
            return(LFDPVM);
        }
Ejemplo n.º 4
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            var temp = e.Parameter as string;

            VM = await Model.GetDetail(temp);
        }