Answered Detect Drag-to-Close gesture

  • 11 Mei 2012 14:56
     
     

    Hi All,

    We have a game using DirectX/C++ and I was wondering how we can detect the drag-to-close gesture has started? We already got:

    ApplicationView::GetForCurrentView()->ViewStateChanged += ref new TypedEventHandler<ApplicationView^, ApplicationViewStateChangedEventArgs^>(this, &LayoutHandler::onLayoutChanged);
    CoreWindow::GetForCurrentThread()->VisibilityChanged += ref new TypedEventHandler<CoreWindow^, VisibilityChangedEventArgs^>(this, &LayoutHandler::onVisibilityChanged);

    but the state change only gets called when the gesture is completed. We'd like to pause our game when the gesture beings.

    Thanks,

    David Goemans

Semua Balasan

  • 13 Mei 2012 3:23
    Moderator
     
     Jawab

    Hi David,

    The window will be deactivated when the user starts the gesture, so you can pause when you detect deactivation in CoreWindow::Activated .

    This will also catch cases like the Settings charm.

    --Rob

    • Ditandai sebagai Jawaban oleh David Goemans 14 Mei 2012 7:46
    •