Beispiel #1
0
        protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
        {
            // hack to always enable the Venue textbox if it has been disabled in the event the user clicks search while keyboard is showing
            this.BackKeyPress += EnableVenueTextBox;

            IDictionary <string, string> parameters = this.NavigationContext.QueryString;

            if (parameters.ContainsKey("PersonId"))
            {
                PersonId = Int32.Parse(parameters["PersonId"]);
            }

            base.OnNavigatedTo(e);

            if (e.NavigationMode != NavigationMode.Back)
            {
                SlideTransition transition = new SlideTransition();
                transition.Mode = SlideTransitionMode.SlideRightFadeIn;

                PhoneApplicationPage page  = (PhoneApplicationPage)((PhoneApplicationFrame)Application.Current.RootVisual).Content;
                ITransition          trans = transition.GetTransition(page);

                trans.Completed += delegate
                {
                    trans.Stop();

                    if (e.NavigationMode == NavigationMode.New)
                    {
                        addDateViewModel = new AddDateViewModel(this);
                        this.DataContext = addDateViewModel;
                    }
                };
                trans.Begin();
            }
        }
Beispiel #2
0
 public IActionResult Add(AddDateViewModel addCategoryViewModel)
 {
     if (ModelState.IsValid)
     {
         PhotoDate newDate = new PhotoDate
         {
             DateTime = addCategoryViewModel.DateTime
         }; context.Dates.Add(newDate);
         context.SaveChanges();
         return(Redirect("/Date"));
     }
     return(View(addCategoryViewModel));
 }
Beispiel #3
0
        public AddDatePage(DateTime?Fecha)
        {
            InitializeComponent();

            viewModel      = new AddDateViewModel(Fecha);
            BindingContext = viewModel;
            if (Fecha != null)
            {
                datePick.Date = new DateTime(Fecha.Value.Year, Fecha.Value.Month, Fecha.Value.Day);
            }
            else
            {
                datePick.Date = DateTime.Now.Date;
            }
        }
Beispiel #4
0
        //[HttpGet("Date")]
        //public IActionResult ListByDate(string date)
        //{
        //    if (!String.IsNullOrEmpty(date))
        //    {
        //        var dates = from s in Photo
        //                    select s;
        //        dates = dates.Where(s => s.DateID.Contains(date));
        //    }
        //    return View(dates.ToList());
        //}
        public IActionResult Add()
        {
            AddDateViewModel addDateViewModel = new AddDateViewModel();

            return(View(addDateViewModel));
        }