microsoft / AppConsult-WinAppsModernizationWorkshop

Windows Apps modernization workshop
MIT License
67 stars 35 forks source link

Need one more point to cleanup at Exercise 4 #47

Closed runceel closed 5 years ago

runceel commented 5 years ago

At end of Exercise 4, there is one more method that must be removed at AddNewExpense.xaml.cs. It is ChildChanged event handler that was added at Exercise 3.

        private void CalendarUwp_ChildChanged(object sender, System.EventArgs e)
        {
            WindowsXamlHost windowsXamlHost = (WindowsXamlHost)sender;

            Windows.UI.Xaml.Controls.CalendarView calendarView =
                (Windows.UI.Xaml.Controls.CalendarView)windowsXamlHost.Child;

            if (calendarView != null)
            {
                calendarView.SelectedDatesChanged += (obj, args) =>
                {
                    if (args.AddedDates.Count > 0)
                    {
                        Messenger.Default.Send<SelectedDateMessage>(new SelectedDateMessage(args.AddedDates[0].DateTime));
                    }
                };
            }
        }
qmatteoq commented 5 years ago

Fixed in 4dbc6cc