예제 #1
0
        private async void PositionTabBar_SelectionChanged(object sender, Syncfusion.XForms.TabView.SelectionChangedEventArgs e)
        {
            if (e.Index == 0 && !this.PackmanView.IsVisible)
            {
                //Output an alert dialogue that will force the user back into the settings page, considering that the place function must occur before anything else
                await AlertHelper.ShowAlertDialogueAsync("You must place the packman first, somewhere on the screen by completing the form on the settings page",
                                                         "Place function is missing");

                this.PositionTabBar.SelectedIndex = 1;
            }
            else if (e.Index == 1)
            {
                ScreenWidth  = this.XPositionView.MaxValue = Application.Current.MainPage.Width;
                ScreenHeight = this.YPositionView.MaxValue = Application.Current.MainPage.Height - 110;

                await IoC.Get <IEventAggregator>()
                .PublishOnUIThreadAsync(new PackmanGridDataHandler()
                {
                    GridHeight = ScreenHeight
                });                    //Since this Grid Height applies only to the this page, and not to any others,

                //Then use EventAggregation instead of a constant

                ApplicationConstants.Origin = new Point(0, ScreenHeight);
            }
        }