//--------------------------------------------------------// //---------------------------------------------------------// //--- METHOD RETURNING PREPORUCENE APPS ---// //---------------------------------------------------------// public mobAppModelAppInfo[] GetNajgledanije() { List <mobAppModelAppInfo> m = new List <mobAppModelAppInfo>(); for (int f = 0; f < allApps.appInfo.Length; f++) { m.Add(allApps.appInfo[f]); } int naj = 2; //if (allApps.appInfo.Length < naj) naj = allApps.appInfo.Length; mobAppModelAppInfo[] ai = new mobAppModelAppInfo[naj]; mobAppModelAppInfo[] mm = m.ToArray(); Array.Sort(mm, delegate(mobAppModelAppInfo a, mobAppModelAppInfo b) { return(b.ratingPoints.CompareTo(a.ratingPoints)); }); for (int i = 0; i < naj; i++) { ai[i] = mm[i]; } return(ai); }
/// <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) { int id = (Int32)e.Parameter; DataUtility d = new DataUtility(); mobAppModelAppInfo a = d.GetApp(id); drugiGrid.DataContext = a; screenshotGrid.DataContext = d.GetScreenShots(id); }