Skip to content

Commit 997b70f

Browse files
committed
xaml interface
1 parent 0806212 commit 997b70f

File tree

4 files changed

+78
-0
lines changed

4 files changed

+78
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#include "pch.h"
2+
#include "XamlApplication.h"
3+
#include "XamlApplication.g.cpp"
4+
5+
namespace winrt::Microsoft::ReactNative::implementation
6+
{
7+
void XamlApplication::EnsureCreated()
8+
{
9+
throw hresult_not_implemented();
10+
}
11+
winrt::Microsoft::ReactNative::XamlApplication XamlApplication::Current()
12+
{
13+
throw hresult_not_implemented();
14+
}
15+
void XamlApplication::AddMetadataProvider(winrt::Microsoft::UI::Xaml::Markup::IXamlMetadataProvider const& otherProvider)
16+
{
17+
throw hresult_not_implemented();
18+
}
19+
winrt::Microsoft::UI::Xaml::Markup::IXamlType XamlApplication::GetXamlType(winrt::Windows::UI::Xaml::Interop::TypeName const& type)
20+
{
21+
throw hresult_not_implemented();
22+
}
23+
winrt::Microsoft::UI::Xaml::Markup::IXamlType XamlApplication::GetXamlType(hstring const& fullName)
24+
{
25+
throw hresult_not_implemented();
26+
}
27+
com_array<winrt::Microsoft::UI::Xaml::Markup::XmlnsDefinition> XamlApplication::GetXmlnsDefinitions()
28+
{
29+
throw hresult_not_implemented();
30+
}
31+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#pragma once
2+
#include "XamlApplication.g.h"
3+
4+
namespace winrt::Microsoft::ReactNative::implementation
5+
{
6+
struct XamlApplication : XamlApplicationT<XamlApplication>
7+
{
8+
XamlApplication() = default;
9+
10+
static void EnsureCreated();
11+
static winrt::Microsoft::ReactNative::XamlApplication Current();
12+
void AddMetadataProvider(winrt::Microsoft::UI::Xaml::Markup::IXamlMetadataProvider const& otherProvider);
13+
winrt::Microsoft::UI::Xaml::Markup::IXamlType GetXamlType(winrt::Windows::UI::Xaml::Interop::TypeName const& type);
14+
winrt::Microsoft::UI::Xaml::Markup::IXamlType GetXamlType(hstring const& fullName);
15+
com_array<winrt::Microsoft::UI::Xaml::Markup::XmlnsDefinition> GetXmlnsDefinitions();
16+
};
17+
}
18+
namespace winrt::Microsoft::ReactNative::factory_implementation
19+
{
20+
struct XamlApplication : XamlApplicationT<XamlApplication, implementation::XamlApplication>
21+
{
22+
};
23+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) Microsoft Corporation.
2+
// Licensed under the MIT License.
3+
4+
namespace Microsoft.ReactNative {
5+
[webhosthidden]
6+
[default_interface]
7+
runtimeclass XamlApplication : Microsoft.UI.Xaml.Application, Microsoft.UI.Xaml.Markup.IXamlMetadataProvider {
8+
XamlApplication();
9+
static void EnsureCreated();
10+
static XamlApplication Current { get; };
11+
void AddMetadataProvider(Microsoft.UI.Xaml.Markup.IXamlMetadataProvider otherProvider);
12+
}
13+
} // namespace Microsoft.ReactNative

vnext/Shared/Shared.vcxitems

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,11 @@
241241
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
242242
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\ReactNativeAppBuilder.idl</DependentUpon>
243243
<SubType>Code</SubType>
244+
</ClCompile>
245+
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\XamlApplication.cpp">
246+
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
247+
<DependentUpon>$(ReactNativeWindowsDir)Microsoft.ReactNative\XamlApplication.idl</DependentUpon>
248+
<SubType>Code</SubType>
244249
</ClCompile>
245250
<ClCompile Include="$(MSBuildThisFileDirectory)BaseFileReaderResource.cpp" />
246251
<ClCompile Include="$(MSBuildThisFileDirectory)BaseScriptStoreImpl.cpp" />
@@ -353,6 +358,11 @@
353358
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
354359
<DependentUpon>$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\ReactNativeAppBuilder.idl</DependentUpon>
355360
<SubType>Code</SubType>
361+
</ClInclude>
362+
<ClInclude Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\XamlApplication.h">
363+
<ExcludedFromBuild Condition="'$(UseFabric)' != 'true'">true</ExcludedFromBuild>
364+
<DependentUpon>$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\.idl</DependentUpon>
365+
<SubType>Code</SubType>
356366
</ClInclude>
357367
<ClCompile Include="$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\DynamicReader.cpp">
358368
<DependentUpon>$(MSBuildThisFileDirectory)..\Microsoft.ReactNative\IJSValueReader.idl</DependentUpon>
@@ -717,6 +727,7 @@
717727
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\UriImageManager.idl" />
718728
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\ViewProps.idl" />
719729
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\ReactNativeAppBuilder.idl" />
730+
<Midl Condition="'$(UseFabric)' == 'true' OR '$(IncludeFabricInterface)' == 'true'" Include="$(ReactNativeWindowsDir)Microsoft.ReactNative\XamlApplication.idl" />
720731
</ItemGroup>
721732
<ItemGroup>
722733
<ClInclude Include="$(NodeApiJsiDir)src\ApiLoaders\HermesApi.h" />

0 commit comments

Comments
 (0)