Files
react-native-svg/windows/RNSVG/LinearGradientViewManager.cpp
Marlene Cota 28d51bdf06 Add Windows support (#1632)
Adds Windows support.

Co-authored-by: Adam Gleitman <adam.gleitman@gmail.com>
Co-authored-by: REDMOND\agnel <agnel@microsoft.com>
2022-07-15 11:50:58 +02:00

33 lines
1.2 KiB
C++

#include "pch.h"
#include "LinearGradientViewManager.h"
#include "LinearGradientViewManager.g.cpp"
using namespace winrt;
using namespace Microsoft::ReactNative;
namespace winrt::RNSVG::implementation {
LinearGradientViewManager::LinearGradientViewManager() {
m_class = RNSVG::SVGClass::RNSVGLinearGradient;
m_name = L"RNSVGLinearGradient";
}
IMapView<hstring, ViewManagerPropertyType> LinearGradientViewManager::NativeProps() {
auto const& parentProps{__super::NativeProps()};
auto const &nativeProps{winrt::single_threaded_map<hstring, ViewManagerPropertyType>()};
for (auto const &prop : parentProps) {
nativeProps.Insert(prop.Key(), prop.Value());
}
nativeProps.Insert(L"x1", ViewManagerPropertyType::String);
nativeProps.Insert(L"y1", ViewManagerPropertyType::String);
nativeProps.Insert(L"x2", ViewManagerPropertyType::String);
nativeProps.Insert(L"y2", ViewManagerPropertyType::String);
nativeProps.Insert(L"gradient", ViewManagerPropertyType::Array);
nativeProps.Insert(L"gradientUnits", ViewManagerPropertyType::Number);
nativeProps.Insert(L"gradientTransform", ViewManagerPropertyType::Array);
return nativeProps.GetView();
}
} // namespace winrt::RNSVG::implementation