Ejemplo n.º 1
0
        void GestureService_OnGestureRaised(object sender, EventArgs e)
        {
            CustomGestureArgs gestureArgs = (CustomGestureArgs)e;

            //NumberFramesToRender += 3;
            if (gestureArgs.ManipulationStartedArgs != null)
            {
            }
            else if (gestureArgs.ManipulationInertiaStartingArgs != null)
            {
            }
            else if (gestureArgs.ManipulationUpdatedArgs != null)
            {
            }
            else if (gestureArgs.ManipulationCompletedArgs != null)
            {
            }
            else if (gestureArgs.TappedEventArgs != null)
            {
            }
            else if (gestureArgs.PressedPointerRoutedEventArgs != null)
            {
            }
            else if (gestureArgs.MovedPointerRoutedEventArgs != null)
            {
                if (_drawLine)
                {
                    _lineEndPoint = gestureArgs.MovedPointerRoutedEventArgs.GetCurrentPoint(null).Position;
                    drawLine(_lineStartPoint, _lineEndPoint, ref lineMain1);
                }
            }
            else if (gestureArgs.ReleasedPointerRoutedEventArgs != null)
            {
                if (_drawLine)
                {
                    _drawLine = false;
                    drawLine(_lineStartPoint, _lineStartPoint, ref lineMain1);
                    performAction(_actionToDoOnRelease);
                }
            }
        }
        public void Initialize(DeviceManager deviceManager)
        {
            _deviceManager = deviceManager;


            // Remove previous buffer
            //SafeDispose(ref constantBuffer);


            // Setup local variables
            var d3dDevice  = deviceManager.DeviceDirect3D;
            var d3dContext = deviceManager.ContextDirect3D;



            spriteBatch.Initialize(d3dDevice, d3dContext, 5000);



            //// Load texture and create sampler
            using (var bitmap = TextureLoader.LoadBitmap(deviceManager.WICFactory, "Assets\\DotPink.png"))
                _textureDot = TextureLoader.CreateTexture2DFromBitmap(d3dDevice, bitmap);
            spriteBatch.AddTexture(_textureDot);

            using (var bitmap = TextureLoader.LoadBitmap(deviceManager.WICFactory, "Assets\\gold-star.png"))
                _textureStar = TextureLoader.CreateTexture2DFromBitmap(d3dDevice, bitmap);
            spriteBatch.AddTexture(_textureStar);


            GestureService.OnGestureRaised += (o, a) =>
            {
                CustomGestureArgs gestureArgs = (CustomGestureArgs)a;

                if (gestureArgs.ManipulationStartedArgs != null)
                {
                }
                else if (gestureArgs.ManipulationInertiaStartingArgs != null)
                {
                }
                else if (gestureArgs.ManipulationUpdatedArgs != null)
                {
                }
                else if (gestureArgs.ManipulationCompletedArgs != null)
                {
                }
                else if (gestureArgs.TappedEventArgs != null)
                {
                }
                else if (gestureArgs.PressedPointerRoutedEventArgs != null)
                {
                    //spriteBatch.IsEnabled = true;
                    //moveDot(gestureArgs.PressedPointerRoutedEventArgs.GetCurrentPoint(null).Position);
                }
                else if (gestureArgs.MovedPointerRoutedEventArgs != null)
                {
                    //moveDot(gestureArgs.MovedPointerRoutedEventArgs.GetCurrentPoint(null).Position);
                }
                else if (gestureArgs.ReleasedPointerRoutedEventArgs != null)
                {
                    //spriteBatch.IsEnabled = false;
                    //moveDot(gestureArgs.ReleasedPointerRoutedEventArgs.GetCurrentPoint(null).Position);
                }
            };



            clock = new Stopwatch();
            clock.Start();
        }
Ejemplo n.º 3
0
        public HomeView()
        {
            this.InitializeComponent();

            PopupService.Init(layoutRoot);

            DownloadService.Current.DownloadCountChanged += Current_DownloadCountChanged;

            layoutRoot.Background = new SolidColorBrush(Colors.Black);

            LoggingService.LogInformation("Showing splash screeen", "Views.HomeView");

            _vm = new HomeViewModel();
            _vm.Load();
            this.DataContext = _vm;

            _fvm = new FlickrViewModel(Dispatcher);
            pbMainLoading.DataContext = _fvm;


            //_vm.ShowLoginCommand.Execute(null);



            try
            {
                Messenger.Default.Register <GeneralSystemWideMessage>(this, DoGeneralSystemWideMessageCallback);
            }
            catch { }


            GestureService.OnGestureRaised += (o, a) => {
                CustomGestureArgs gestureArgs = (CustomGestureArgs)a;
                //NumberFramesToRender += 3;
                if (gestureArgs.ManipulationStartedArgs != null)
                {
                }
                else if (gestureArgs.ManipulationInertiaStartingArgs != null)
                {
                }
                else if (gestureArgs.ManipulationUpdatedArgs != null)
                {
                }
                else if (gestureArgs.ManipulationCompletedArgs != null)
                {
                }
                else if (gestureArgs.TappedEventArgs != null)
                {
                }
                else if (gestureArgs.PressedPointerRoutedEventArgs != null)
                {
                }
                else if (gestureArgs.MovedPointerRoutedEventArgs != null)
                {
                    if (_drawLine)
                    {
                        _lineEndPoint = gestureArgs.MovedPointerRoutedEventArgs.GetCurrentPoint(null).Position;
                        drawLine(_lineStartPoint, _lineEndPoint);
                    }
                }
                else if (gestureArgs.ReleasedPointerRoutedEventArgs != null)
                {
                    if (_drawLine)
                    {
                        _drawLine = false;
                        drawLine(_lineStartPoint, _lineStartPoint);
                        performAction(_actionToDo);
                    }
                }
            };

            //AppDatabase.Current.DeleteProjects(SessionID);

            AppService.NetworkConnectionChanged      += AppService_NetworkConnectionChanged;
            WindowLayoutService.OnWindowLayoutRaised += WindowLayoutService_OnWindowLayoutRaised;
        }