|
| 1 | +#include "pch.h" |
| 2 | +#include "ScreenStackHeaderSubviewViewManager.h" |
| 3 | +#include "JSValueXaml.h" |
| 4 | +#include "NativeModules.h" |
| 5 | +#include "ScreenStackHeaderSubview.h" |
| 6 | + |
| 7 | +namespace winrt { |
| 8 | +using namespace Microsoft::ReactNative; |
| 9 | +using namespace Windows::Foundation; |
| 10 | +using namespace Windows::Foundation::Collections; |
| 11 | +using namespace Windows::UI; |
| 12 | +using namespace Windows::UI::Xaml; |
| 13 | +using namespace Windows::UI::Xaml::Controls; |
| 14 | +} // namespace winrt |
| 15 | + |
| 16 | +namespace winrt::RNScreens::implementation { |
| 17 | +// IViewManager |
| 18 | +winrt::hstring ScreenStackHeaderSubviewViewManager::Name() noexcept { |
| 19 | + return L"RNSScreenStackHeaderSubview"; |
| 20 | +} |
| 21 | + |
| 22 | +winrt::FrameworkElement |
| 23 | +ScreenStackHeaderSubviewViewManager::CreateView() noexcept { |
| 24 | + return winrt::make<ScreenStackHeaderSubview>(m_reactContext); |
| 25 | +} |
| 26 | + |
| 27 | +// IViewManagerRequiresNativeLayout |
| 28 | +bool ScreenStackHeaderSubviewViewManager::RequiresNativeLayout() { |
| 29 | + return true; |
| 30 | +} |
| 31 | + |
| 32 | +// IViewManagerWithReactContext |
| 33 | +winrt::IReactContext |
| 34 | +ScreenStackHeaderSubviewViewManager::ReactContext() noexcept { |
| 35 | + return m_reactContext; |
| 36 | +} |
| 37 | + |
| 38 | +void ScreenStackHeaderSubviewViewManager::ReactContext( |
| 39 | + IReactContext reactContext) noexcept { |
| 40 | + m_reactContext = reactContext; |
| 41 | +} |
| 42 | + |
| 43 | +// IViewManagerWithNativeProperties |
| 44 | +IMapView<hstring, ViewManagerPropertyType> |
| 45 | +ScreenStackHeaderSubviewViewManager::NativeProps() noexcept { |
| 46 | + auto nativeProps = |
| 47 | + winrt::single_threaded_map<hstring, ViewManagerPropertyType>(); |
| 48 | + return nativeProps.GetView(); |
| 49 | +} |
| 50 | + |
| 51 | +void ScreenStackHeaderSubviewViewManager::UpdateProperties( |
| 52 | + FrameworkElement const &view, |
| 53 | + IJSValueReader const &propertyMapReader) noexcept { |
| 54 | + (void)view; |
| 55 | + const JSValueObject &propertyMap = JSValue::ReadObjectFrom(propertyMapReader); |
| 56 | + for (auto const &pair : propertyMap) { |
| 57 | + auto const &propertyName = pair.first; |
| 58 | + auto const &propertyValue = pair.second; |
| 59 | + (void)propertyName; |
| 60 | + (void)propertyValue; |
| 61 | + } |
| 62 | +} |
| 63 | + |
| 64 | +// IViewManagerWithExportedEventTypeConstants |
| 65 | +ConstantProviderDelegate ScreenStackHeaderSubviewViewManager:: |
| 66 | + ExportedCustomBubblingEventTypeConstants() noexcept { |
| 67 | + return nullptr; |
| 68 | +} |
| 69 | + |
| 70 | +ConstantProviderDelegate ScreenStackHeaderSubviewViewManager:: |
| 71 | + ExportedCustomDirectEventTypeConstants() noexcept { |
| 72 | + return nullptr; |
| 73 | +} |
| 74 | + |
| 75 | +// IViewManagerWithCommands |
| 76 | +IVectorView<hstring> ScreenStackHeaderSubviewViewManager::Commands() noexcept { |
| 77 | + auto commands = winrt::single_threaded_vector<hstring>(); |
| 78 | + return commands.GetView(); |
| 79 | +} |
| 80 | + |
| 81 | +void ScreenStackHeaderSubviewViewManager::DispatchCommand( |
| 82 | + FrameworkElement const &view, |
| 83 | + winrt::hstring const &commandId, |
| 84 | + winrt::IJSValueReader const &commandArgsReader) noexcept { |
| 85 | + (void)view; |
| 86 | + (void)commandId; |
| 87 | + (void)commandArgsReader; |
| 88 | +} |
| 89 | +} // namespace winrt::RNScreens::implementation |
0 commit comments