Пример #1
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();
            // Create a SwingingEntrance Animation for our WalkDetails TableView
            WalkDetails.RotationY = 180;
            await WalkDetails.RotateYTo(0, 1000, Easing.BounceOut);

            WalkDetails.AnchorX = 0.5;
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "Id,Date,Time,Distance,NumberOfDogs,WalkId")] WalkDetails walkDetails)
 {
     if (ModelState.IsValid)
     {
         db.Entry(walkDetails).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index", "Owners"));
     }
     return(View(walkDetails));
 }
Пример #3
0
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            WalkDetails.RotationY = 180;
            await WalkDetails.RotateYTo(0, 1000, Easing.BounceOut);

            WalkDetails.AnchorX = 0.5;

            DifficultyLevel.AnchorY = (Math.Min(DifficultyLevel.Width, DifficultyLevel.Height) / 2) / DifficultyLevel.Height;

            await DifficultyLevel.RotateTo(360, 2000, Easing.BounceOut);
        }
Пример #4
0
        // Method to initialise our View Model when the ContentPage appears
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            // Create a Simple Animation to rotate our Difficulty Level Image
            DifficultyLevel.AnchorY = (Math.Min(DifficultyLevel.Width, DifficultyLevel.Height) / 2) / DifficultyLevel.Height;
            await DifficultyLevel.RotateTo(360, 2000, Easing.BounceOut);

            // Create a SwingingEntrance Animation for our WalkDetails TableView
            WalkDetails.RotationY = 180;
            await WalkDetails.RotateYTo(0, 1000, Easing.BounceOut);

            WalkDetails.AnchorX = 0.5;
        }
Пример #5
0
        // GET: WalkDetails/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            WalkDetails walkDetails = db.WalkDetails.Find(id);

            if (walkDetails == null)
            {
                return(HttpNotFound());
            }
            return(View(walkDetails));
        }
Пример #6
0
        public ActionResult Create([Bind(Include = "Id,Date,Time,Distance,NumberOfDogs,WalkId")] WalkDetails walkDetails)
        {
            var userResult  = User.Identity.GetUserId();
            var currentUser = db.Owners.Where(x => userResult == x.ApplicationId).FirstOrDefault();
            var walksByUser = db.Walks.Where(x => currentUser.Id == x.OwnerId).ToList();
            var lastWalk    = walksByUser.LastOrDefault();

            walkDetails.WalkId = lastWalk.Id;
            if (ModelState.IsValid)
            {
                db.WalkDetails.Add(walkDetails);
                db.SaveChanges();
                return(RedirectToAction("Index", "Owners"));
            }
            return(View(walkDetails));
        }
Пример #7
0
        // GET: WalkDetails/Create
        public ActionResult Create()
        {
            WalkDetails walkDetails = new WalkDetails();

            return(View(walkDetails));
        }