Example #1
0
        public MainPage()
        {
            InitializeComponent();

            for (int i = 0; i < 20; i++)
            {
                var twnk = new TwinkleStar(i);
                _tinkleCanvas.Children.Add(twnk);
                _stars.Add(twnk);
            }

            for (int i = 0; i < 3; i++)
            {
                var ballon = new FloatingBallon(i);
                _tinkleCanvas.Children.Add(ballon);
            }

            _nextTapAction = () =>
            {
                _typeOfPresentWheel.Spin();
                _nextTapAction = null;
            };

            Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().Title = "Grattis";

            _bandIO.Connect();
            _bandIO.Pulled += () =>
            {
                if ((DateTime.UtcNow - _lastAcccelerometerAction).TotalSeconds < 1)
                    return;
                _lastAcccelerometerAction = DateTime.UtcNow;
                Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => _nextTapAction?.Invoke());
            };
        }
Example #2
0
        public MainPage()
        {
            InitializeComponent();

            for (int i = 0; i < 20; i++)
            {
                var twnk = new TwinkleStar(i);
                _tinkleCanvas.Children.Add(twnk);
                _stars.Add(twnk);
            }

            for (int i = 0; i < 3; i++)
            {
                var ballon = new FloatingBallon(i);
                _tinkleCanvas.Children.Add(ballon);
            }

            _nextTapAction = () =>
            {
                _typeOfPresentWheel.Spin();
                _nextTapAction = null;
            };

            Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().Title = "Grattis";

            _bandIO.Connect();
            _bandIO.Pulled += () =>
            {
                if ((DateTime.UtcNow - _lastAcccelerometerAction).TotalSeconds < 1)
                {
                    return;
                }
                _lastAcccelerometerAction = DateTime.UtcNow;
                Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => _nextTapAction?.Invoke());
            };
        }