No Description

WebBridge.cpp 531B

1234567891011121314151617181920
  1. #include "pch.h"
  2. #include "WebBridge.h"
  3. #include "WebBridge.g.cpp"
  4. namespace winrt::WebViewBridgeComponent::implementation
  5. {
  6. void WebBridge::PostMessage(hstring const& message)
  7. {
  8. m_messageEvent(*this, message);
  9. }
  10. winrt::event_token WebBridge::MessagePostEvent(Windows::Foundation::EventHandler<hstring> const& handler)
  11. {
  12. return m_messageEvent.add(handler);
  13. }
  14. void WebBridge::MessagePostEvent(winrt::event_token const& token) noexcept
  15. {
  16. m_messageEvent.remove(token);
  17. }
  18. }