This commit is contained in:
Родитель
b279b4d23b
Коммит
bf2407ba25
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "react-native-xaml",
|
||||
"title": "React Native Xaml",
|
||||
"version": "0.0.44",
|
||||
"version": "0.0.45",
|
||||
"description": "Allows using XAML directly, inside of a React Native Windows app",
|
||||
"main": "lib/index.js",
|
||||
"typings": "lib/index.d.ts",
|
||||
|
|
|
@ -151,6 +151,7 @@
|
|||
<ClInclude Include="Codegen\TypeEvents.g.h" />
|
||||
<ClInclude Include="Codegen\TypeProperties.g.h" />
|
||||
<ClInclude Include="Crc32Str.h" />
|
||||
<ClInclude Include="JSValueXaml_local.h" />
|
||||
<ClInclude Include="ReactPackageProvider.h">
|
||||
<DependentUpon>ReactPackageProvider.idl</DependentUpon>
|
||||
</ClInclude>
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
<ClInclude Include="Codegen\TypeEnums.g.h">
|
||||
<Filter>Codegen</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="JSValueXaml_local.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="PropertySheet.props" />
|
||||
|
|
|
@ -55,52 +55,6 @@ namespace winrt::Microsoft::ReactNative {
|
|||
inline void ReadValue(JSValue const& jsValue, Windows::UI::Text::FontWeight& value) noexcept {
|
||||
value.Weight = jsValue.AsInt16();
|
||||
}
|
||||
|
||||
inline void ReadValue(JSValue const& jsValue, xaml::Thickness& value) noexcept {
|
||||
if (auto array = jsValue.TryGetArray()) {
|
||||
if (array->size() == 4) {
|
||||
value = ThicknessHelper::FromLengths((*array)[0].AsDouble(), (*array)[1].AsDouble(), (*array)[2].AsDouble(), (*array)[3].AsDouble());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (auto number = jsValue.TryGetDouble()) {
|
||||
value = ThicknessHelper::FromUniformLength(*number);
|
||||
}
|
||||
else if (auto numberInt = jsValue.TryGetInt64()) {
|
||||
const auto valueDbl = static_cast<double>(*numberInt);
|
||||
value = ThicknessHelper::FromUniformLength(valueDbl);
|
||||
}
|
||||
else {
|
||||
const auto& obj = jsValue.AsObject();
|
||||
value = ThicknessHelper::FromLengths(obj["left"].AsDouble(), obj["top"].AsDouble(), obj["right"].AsDouble(), obj["bottom"].AsDouble());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
inline void ReadValue(JSValue const& jsValue, xaml::CornerRadius& value) noexcept {
|
||||
if (auto array = jsValue.TryGetArray()) {
|
||||
if (array->size() == 4) {
|
||||
value = CornerRadiusHelper::FromRadii((*array)[0].AsDouble(), (*array)[1].AsDouble(), (*array)[2].AsDouble(), (*array)[3].AsDouble());
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (auto number = jsValue.TryGetDouble()) {
|
||||
value = CornerRadiusHelper::FromUniformRadius(*number);
|
||||
}
|
||||
else if (auto numberInt = jsValue.TryGetInt64()) {
|
||||
const auto valueDbl = static_cast<double>(*numberInt);
|
||||
value = CornerRadiusHelper::FromUniformRadius(valueDbl);
|
||||
}
|
||||
else {
|
||||
const auto& obj = jsValue.AsObject();
|
||||
value = CornerRadiusHelper::FromRadii(obj["topLeft"].AsDouble(), obj["topRight"].AsDouble(), obj["bottomRight"].AsDouble(), obj["bottomLeft"].AsDouble());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
inline void ReadValue(JSValue const& jsValue, winrt::Windows::Foundation::Uri& value) noexcept {
|
||||
value = Uri{ winrt::to_hstring(jsValue.AsString()) };
|
||||
}
|
||||
}
|
||||
|
||||
enum class XamlPropType {
|
||||
|
|
Загрузка…
Ссылка в новой задаче