예제 #1
0
        private async void MapBtn_Clicked(object sender, EventArgs e)
        {
            Lock();
            map.DrawPastPath();
            await Navigation.PushModalAsync(map);

            map.ClearPastPath();
            UnLock();
        }
예제 #2
0
        private async void AttachHint(int hintIndex)
        {
            if (nextAttraction.IsThisLastHint(hintIndex))
            {
                //TODO change when shahar will finish
                // mapInstance = new MapPage(new SheredClasses.Point(nextAttraction.x, nextAttraction.y));
                if (firstAttachOfHintMap)
                {
                    myMap.AddPointToMap(new SheredClasses.Point(nextAttraction.x, nextAttraction.y), nextAttraction);
                }
                hintWebView.IsVisible = false;
                hintText.IsVisible    = false;
                myMap.DrawPastPath();
                await Navigation.PushModalAsync(myMap);

                myMap.ClearPastPath();
                firstAttachOfHintMap = false;
                //hintMap = myMap.map;
                //hintMap.IsVisible = true;
            }
            else
            {
                //hintMap.IsVisible = false;
                Hint currentHint = nextAttraction.hints[hintIndex];
                if (currentHint.GetKindHint() == Hint.Kinds.HintPicture || currentHint.GetKindHint() == Hint.Kinds.HintVideo)
                {
                    if (currentHint.GetKindHint() == Hint.Kinds.HintPicture)
                    {
                        hintText.IsVisible    = false;
                        hintWebView.IsVisible = false;
                        await Task.Delay(100);

                        hintImg.IsVisible = true;
                        hintImg.Aspect    = Aspect.AspectFit;
                        hintImg.Source    = ImageSource.FromUri(new Uri(currentHint.data));
                    }
                    else
                    {
                        hintImg.IsVisible     = false;
                        hintText.IsVisible    = false;
                        hintWebView.IsVisible = true;
                        hintWebView.Source    = currentHint.data;
                    }
                }
                else //case text
                {
                    hintImg.IsVisible     = false;
                    hintWebView.IsVisible = false;
                    hintText.IsVisible    = true;
                    hintText.Text         = gc.GetCurrentLanguageText(currentHint.data);
                }
            }
            if (nextAttraction.IsThisLastHint(hintIndex))
            {
                title.Text = AppResources.last_hint;
            }
            else
            {
                title.Text = AppResources.hint + " " + (hintIndex + 1);
            }
            title.IsVisible = true;
        }