Ejemplo n.º 1
0
        void OnMoreOptionItemClicked(object sender, MoreOptionItemEventArgs e)
        {
            var formsMoreOptionItem = e.Item as FormsMoreOptionItem;

            if (formsMoreOptionItem != null)
            {
                ((IMenuItemController)formsMoreOptionItem.ToolbarItem)?.Activate();
            }
            _moreOption.Value.IsOpened = false;
        }
        /// <summary>
        /// Handle the event of the select on the ViewOption.
        /// </summary>
        /// <param name="sender">Specifies the sender object</param>
        /// <param name="oe">Specifies the occured event</param>
        private void ViewOptionSelected(object sender, MoreOptionItemEventArgs oe)
        {
            // Remove the used data
            ClearData();

            if (oe.Item.MainText == "Map")
            {
                view = ViewPage.MAP;
                ((MoreOption)sender).IsOpened = false;
            }
            else if (oe.Item.MainText == "POI")
            {
                view = ViewPage.POI;

                // Create the RotarySelector for the category
                var poiSelector = new RotarySelector(window)
                {
                    AlignmentX = -1,
                    AlignmentY = -1,
                    WeightX    = 1,
                    WeightY    = 1
                };
                foreach (string category in HereCategory)
                {
                    poiSelector.Items.Add(new RotarySelectorItem()
                    {
                        MainText = category
                    });
                }

                poiSelector.Show();

                poiSelector.Clicked += (s, e) =>
                {
                    // Request the pois with the center position
                    RequestPOI(new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude), e.Item.MainText);

                    poiSelector.Unrealize();

                    ((MoreOption)sender).IsOpened = false;
                };
                poiSelector.BackButtonPressed += (s, e) => { poiSelector.Unrealize(); };
            }
            else if (oe.Item.MainText == "Route")
            {
                view = ViewPage.ROUTE;
                ((MoreOption)sender).IsOpened = false;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Handle the event of the select on the ViewOption.
        /// ViewOption에서 selected 이벤트를 처리합니다.
        /// </summary>
        /// <param name="sender">Specifies the sender object</param>
        /// <param name="oe">Specifies the occured event</param>
        private void ViewOptionSelected(object sender, MoreOptionItemEventArgs oe)
        {
            // Remove the used data
            // 사용된 데이터를 제거합니다.
            ClearData();

            // MoreOption의 아이템 중에 MainText가
            // Map이면
            if (oe.Item.MainText == "Map")
            {
                // view를 MAP으로 초기화
                view = ViewPage.MAP;
                // IsOpend false로 설정
                ((MoreOption)sender).IsOpened = false;
            }
            // POI이면
            else if (oe.Item.MainText == "POI")
            {
                // view를 POI로 초기화
                view = ViewPage.POI;

                // Create the RotarySelector for the category
                // 카테고리에 대한 RotarySelector 만들기
                var poiSelector = new RotarySelector(window)
                {
                    AlignmentX = -1,
                    AlignmentY = -1,
                    WeightX    = 1,
                    WeightY    = 1
                };
                foreach (string category in HereCategory)
                {
                    // poiSelector에 HerCategory의 category만큼 아이템 추가
                    poiSelector.Items.Add(new RotarySelectorItem()
                    {
                        MainText = category
                    });
                }

                poiSelector.Show();

                // poiSelector를 클릭했을 때
                poiSelector.Clicked += (s, e) =>
                {
                    // Request the pois with the center position
                    // 중앙위치로 POI 리퀘스트
                    RequestPOI(new Geocoordinates(s_mapview.Center.Latitude, s_mapview.Center.Longitude), e.Item.MainText);

                    poiSelector.Unrealize();

                    ((MoreOption)sender).IsOpened = false;
                };
                // 뒤로가기 버튼을 눌렀을 때 poiSelector 해제
                poiSelector.BackButtonPressed += (s, e) => { poiSelector.Unrealize(); };
            }
            // Route이면
            else if (oe.Item.MainText == "Route")
            {
                // view를 ROUTE로 초기화
                view = ViewPage.ROUTE;
                ((MoreOption)sender).IsOpened = false;
            }
        }