Ejemplo n.º 1
0
        //------------------------------------------------------END ROUTING-----------------------------------------------//



        void Entry_TextChanged(object sender, TextChangedEventArgs e)
        {
            var oldText = e.OldTextValue;
            var newText = e.NewTextValue;
            var test2   = VenueService.GetShowareFirst();

            if (string.IsNullOrEmpty(e.NewTextValue))
            {
                SearchView.ItemsSource = VenueService.GetShowareFirst();
            }
            else
            {
                SearchView.ItemsSource = test2.Where(x => x.IconName.StartsWith(e.NewTextValue, StringComparison.Ordinal));
            }
        }
Ejemplo n.º 2
0
        public MapView()
        {
            InitializeComponent();

            topSearch.IsVisible        = false;
            topSearchView.IsVisible    = false;
            goIcon.IsVisible           = false;
            bottomSearch.IsVisible     = false;
            bottomSearchView.IsVisible = false;
            xIcon.IsVisible            = false;
            SearchView.IsVisible       = false;

            map = LevelService.GetLevel();

            SearchView.ItemsSource = VenueService.GetShowareFirst();
            LevelView.ItemsSource  = LevelService.GetLevel();

            LevelView.IsVisible       = false;
            LevelName.IsVisible       = false;
            LevelBackground.IsVisible = false;
        }
Ejemplo n.º 3
0
        public void MapSwitch(string theMap, int theLevel)
        {
            myLevel = theLevel;
            if (theMap == "Showare")
            {
                if (theLevel == 1)
                {
                    icons = VenueService.GetTest();
                }
                else if (theLevel == 2)
                {
                    icons = VenueService.GetShowareSecond();
                }
            }


            //remove current map

            ptz.Content = null;

            //new abs layout
            abs = new AbsoluteLayout();
            //AbsoluteLayout.SetLayoutBounds(abs, new Rectangle(1, 1, 1, 1));
            //AbsoluteLayout.SetLayoutFlags(abs, AbsoluteLayoutFlags.All);

            //get map image

            foreach (LevelItems l in map.Where(l => l.Venue == theMap && l.Floor == theLevel))
            {
                //the current map image
                myGrid          = l.MapGrid;
                currentMapImage = new Image
                {
                    Source = l.Image
                };
            }


            AbsoluteLayout.SetLayoutBounds(abs, new Rectangle(1, 1, currentMapImage.Width, currentMapImage.Height));
            //AbsoluteLayout.SetLayoutFlags(abs, AbsoluteLayoutFlags.PositionProportional);


            //set the layout
            AbsoluteLayout.SetLayoutBounds(currentMapImage, new Rectangle(1, 1, 1, 1));
            AbsoluteLayout.SetLayoutFlags(currentMapImage, AbsoluteLayoutFlags.All);
            abs.Children.Add(currentMapImage);

            var tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += OnTapGestureRecognizerTapped2;

            //get correct icons for level and venue
            myCanvas = new SKCanvasView();

            AbsoluteLayout.SetLayoutBounds(myCanvas, new Rectangle(1, 1, 1, 1));
            AbsoluteLayout.SetLayoutFlags(myCanvas, AbsoluteLayoutFlags.All);
            abs.Children.Add(myCanvas);
            //SetupRouting();

            foreach (VenueIcons l in icons.Where(l => l.Venue == theMap && l.Floor == theLevel))
            {
                mapIcon = new Image
                {
                    Source  = l.Image,
                    ClassId = l.IconName,
                };
                mapIcon.GestureRecognizers.Add(tapGestureRecognizer);
                mapIcon.AnchorX = l.LayoutX;
                mapIcon.AnchorY = l.LayoutY;
                abs.Children.Add(mapIcon);

                AbsoluteLayout.SetLayoutBounds(mapIcon, new Rectangle(l.LayoutX, l.LayoutY, l.LayoutW, l.LayoutH));
                AbsoluteLayout.SetLayoutFlags(mapIcon, AbsoluteLayoutFlags.SizeProportional);
            }



            ptz.Content = abs;
            System.Diagnostics.Debug.WriteLine(ptz.WidthRequest + "  SCREEN WIDTH");
            System.Diagnostics.Debug.WriteLine(ptz.MinimumWidthRequest + "  SCREEN HEIGHT");
        }