Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        public RouteDataStore()
        {
            routes = new List <Route>();

            if (Device.RuntimePlatform == Device.iOS)
            {
                routes.Add(new Route
                {
                    StartDestination = string.Empty,
                    EndDestination   = string.Empty,
                    Date             = string.Empty,
                    BGColorHexCode   = "#52597F",
                    IsSelected       = false
                });
            }

            routes.Add(new Route
            {
                StartDestination = "Tuzla",
                EndDestination   = "Gebze",
                BGColorHexCode   = "#52597F",
                Date             = DateTime.Today.ToShortDateString(),
                IsSelected       = false
            });

            routes.Add(new Route
            {
                StartDestination = "Bati Hereke",
                EndDestination   = "Dil Iskelesi",
                BGColorHexCode   = "#52597F",
                IsBookmarked     = true,
                Date             = DateTime.Today.ToShortDateString(),
                IsSelected       = false
            });


            routes.Add(new Route
            {
                StartDestination = "Kartal",
                EndDestination   = "Samandira",
                BGColorHexCode   = "#52597F",
                Date             = DateTime.Today.ToShortDateString(),
                IsSelected       = false
            });



            //Dört ekli, listede bir eksik
            var t = RouteDBContextHelper.GetRoutes().Result.ToList();

            t = t.OrderBy(x => x.IsBookmarked).ToList();
            if (t.Count == 0)
            {
                RouteDBContextHelper.AddOrUpdatePostsAsync(routes);
                t = RouteDBContextHelper.GetRoutes().Result.ToList().OrderBy(x => x.IsBookmarked).ToList();
            }

            ExtendedFrame.CurrentRoutes = t;
        }
Esempio n. 2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="forceRefresh"></param>
 /// <returns></returns>
 public async Task <IEnumerable <Route> > GetItemsAsync(bool forceRefresh = false)
 {
     return(await Task.FromResult(RouteDBContextHelper.GetRoutes().Result));
 }