Files
react-native-svg/windows/RNSVG/RenderableViewManager.h
Eric Rozell 9f6f6fd40c Adds support to compile react-native-svg against WinAppSDK (#2255)
# Summary

Adds namespace redirects required to compile react-native-svg sources
against WinAppSDK for react-native-windows.

## Test Plan

There aren't a lot of examples for building react-native-windows apps in
open source targeting WinAppSDK, but we have some proprietary builds,
and this source code is working there (it is also still compatible with
UWP).
2024-04-12 11:10:19 +02:00

36 lines
1.3 KiB
C++

#pragma once
#include "RenderableViewManager.g.h"
#include "RenderableView.h"
namespace winrt::RNSVG::implementation {
struct RenderableViewManager : RenderableViewManagerT<RenderableViewManager> {
public:
RenderableViewManager() = default;
// IViewManager
hstring Name() { return m_name; }
xaml::FrameworkElement CreateView();
// IViewManagerWithReactContext
Microsoft::ReactNative::IReactContext ReactContext() { return m_reactContext; }
void ReactContext(Microsoft::ReactNative::IReactContext const &value) { m_reactContext = value; }
// IViewManagerWithNativeProperties
void UpdateProperties(
xaml::FrameworkElement const &view,
Microsoft::ReactNative::IJSValueReader const &propertyMapReader);
virtual
Windows::Foundation::Collections::IMapView<hstring, Microsoft::ReactNative::ViewManagerPropertyType> NativeProps();
protected:
Microsoft::ReactNative::IReactContext m_reactContext{nullptr};
RNSVG::SVGClass m_class{RNSVG::SVGClass::Unknown};
hstring m_name{};
};
} // namespace winrt::RNSVG::implementation
namespace winrt::RNSVG::factory_implementation {
struct RenderableViewManager : RenderableViewManagerT<RenderableViewManager, implementation::RenderableViewManager> {};
} // namespace winrt::RNSVG::factory_implementation