locked
converting objects?

    Question

  • Does anyone know how to convert Platform::Object to a xaml control(like a checkbox)?

    void app1::mainpage::button1Click(Platform::Object^ sender, Windows::UI::Xaml::RoutedEventArgs^ e)
    {
    
    }

    Like above? I'm trying to get the content property of the object that triggered the event.

    Friday, November 23, 2012 8:29 PM

Answers

  • You can use safe_cast like

     auto button = safe_cast<Windows::UI::Xaml::Controls::Button^>(sender);

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by slycoder127 Monday, December 3, 2012 5:09 PM
    Monday, November 26, 2012 9:08 AM