Exemplo n.º 1
0
 public void Pressed(Point p, BubbleContainer bc)
 {
     pressed = true;
     lastposition = p;
     currentBubble = bc.catchBubble(p);
     if (currentBubble != null) currentBubble.setDragged(true);
 }
Exemplo n.º 2
0
        public MainPage()
        {
            this.InitializeComponent();
            BubbleContainer.canvas = BubbleCanvas;
            currentContainer = new BubbleContainer();
            dragController = new DragController();
            Window.Current.CoreWindow.PointerReleased += CoreWindow_PointerReleased;
            Window.Current.CoreWindow.SizeChanged +=CoreWindow_SizeChanged;

            // Create a periodic work schedule - every 1 millisecond update all the bubbles.
            // http://msdn.microsoft.com/en-US/library/windows/apps/jj248676
            TimeSpan period = TimeSpan.FromMilliseconds(1);
            ThreadPoolTimer PeriodicTimer = ThreadPoolTimer.CreatePeriodicTimer((source) =>
            {
                // Update the UI thread by using the UI core dispatcher.
                Dispatcher.RunAsync(CoreDispatcherPriority.High,
                    () =>
                    {
                        currentContainer.tick();
                    });

            }, period);
        }