Пример #1
0
        //======================================================================
        //                       Canvas Functions
        //======================================================================

        // For mouse clicks
        private void Click(object sender, MouseButtonEventArgs e)
        {
            if ((canPlaceHouse) && (!tagDetected))
            {
                RoadCanvas.IsEnabled = false;
                redoList             = new List <Object>();
                e.Handled            = true;
                UrbanTagVisualizer.UpdateLayout();
                Point mousePosition = e.GetPosition(this);

                // Setting the ScatterView image background
                ScatterViewItem item = SetSVHouseImage(houseType);

                item.Center      = mousePosition;
                item.Orientation = 0;

                MainScatterview.Items.Add(item);
                userPlacedHouses.Add(item);
                history.Push(item);
            }
            else if ((canPlaceRoad) && (!tagDetected))
            {
                RoadCanvas.IsEnabled = true;
            }
        }
Пример #2
0
        // For hold gestures
        private void gesturebox_HoldGesture(object sender, TouchEventArgs e)
        {
            if ((canPlaceHouse) && (!tagDetected))
            {
                redoList  = new List <Object>();
                e.Handled = true;
                UrbanTagVisualizer.UpdateLayout();
                Point p = e.TouchDevice.GetPosition(this);

                // Setting the ScatterView image background
                ScatterViewItem item = SetSVHouseImage(houseType);

                item.Center      = p;
                item.Orientation = 0;
                MainScatterview.Items.Add(item);
                userPlacedHouses.Add(item);
                history.Push(item);
            }
        }