Esempio n. 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)
        {
            SVCEventicaService.ServiceClient objclient = new SVCEventicaService.ServiceClient();

            SampleDataGroup group = new SampleDataGroup("1", "Event Review", "", "", "");

            SVCEventicaService.eventreview objreviewbal = new SVCEventicaService.eventreview();

            var objreviewballist = await objclient.SelectEventReviewByEventAsync((int)e.NavigationParameter);

            for (int i = 0; i < objreviewballist.Count; i++)
            {
                group.Items.Add(new SampleDataItem(objreviewballist[i].eventreviewid.ToString(),"By: "+objreviewballist[i].contactname,"Email: "+objreviewballist[i].email,"Mobile: "+objreviewballist[i].mobileno,"Review:\n"+objreviewballist[i].reviewdetail,"Review Date: " +objreviewballist[i].reviewdate.ToString ()));
            }
            this.defaultViewModel["Groups"] = group;
            this.DefaultViewModel["Items"] = group.Items;
        }
Esempio n. 2
0
        private async Task GetSampleDataAsync()
        {
            if (this._groups.Count != 0)
                return;

            Uri dataUri = new Uri("ms-appx:///DataModel/SampleData.json");

            StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
            string jsonText = await FileIO.ReadTextAsync(file);
            JsonObject jsonObject = JsonObject.Parse(jsonText);
            JsonArray jsonArray = jsonObject["Groups"].GetArray();

            foreach (JsonValue groupValue in jsonArray)
            {
                JsonObject groupObject = groupValue.GetObject();
                SampleDataGroup group = new SampleDataGroup(groupObject["UniqueId"].GetString(),
                                                            groupObject["Title"].GetString(),
                                                            groupObject["Subtitle"].GetString(),
                                                            groupObject["ImagePath"].GetString(),
                                                            groupObject["Description"].GetString());

                foreach (JsonValue itemValue in groupObject["Items"].GetArray())
                {
                    JsonObject itemObject = itemValue.GetObject();
                    group.Items.Add(new SampleDataItem(itemObject["UniqueId"].GetString(),
                                                       itemObject["Title"].GetString(),
                                                       itemObject["Subtitle"].GetString(),
                                                       itemObject["ImagePath"].GetString(),
                                                       itemObject["Description"].GetString(),
                                                       itemObject["Content"].GetString()));
                }
                this.Groups.Add(group);
            }
        }