Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate more of UIManager #5

Merged
merged 2 commits into from
Oct 18, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ReactWindows/ReactNative.Net46/ReactNative.Net46.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down Expand Up @@ -61,6 +61,7 @@
<Private>True</Private>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Reactive.Core, Version=3.0.0.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
Expand Down Expand Up @@ -89,6 +90,7 @@
<HintPath>..\packages\PCLStorage.1.0.2\lib\net45\PCLStorage.Abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xaml" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand Down Expand Up @@ -125,4 +127,4 @@
<Target Name="AfterBuild">
</Target>
-->
</Project>
</Project>
20 changes: 20 additions & 0 deletions ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -105,19 +105,39 @@
<Compile Include="$(MSBuildThisFileDirectory)UIManager\Annotations\ReactPropBaseAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\Annotations\ReactPropGroupAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\AppRegistry.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\BorderExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\ColorHelpers.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\CSSNodeExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\CSSNodeVisitor.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\DependencyObjectExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\Dimensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\Events\Event.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\Events\EventDispatcher.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\Events\RCTEventEmitter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\Events\TouchEventType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\Events\TouchEventTypeExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\IReactCompoundView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\IRootView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\AnimatedPropertyType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\BaseLayoutAnimation.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\InterpolationType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\InterpolationTypeExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\LayoutAnimation.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\LayoutAnimationController.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\LayoutCreateAnimation.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\LayoutDeleteAnimation.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\LayoutUpdateAnimation.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\LayoutAnimation\StoryboardObservable.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\MatrixMathHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\MeasureAssertions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\OnLayoutEvent.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\PointerEvents.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\ReactDefaultCompoundView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\ReactStylesDiffMap.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\ReactStylesDiffMapExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\SizeMonitoringCanvas.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\ThemedReactContext.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\TransformHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\ViewAtIndex.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UIManager\ViewProps.cs" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
using Facebook.CSSLayout;
#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using System.Windows;
using System.Windows.Controls;
#endif

namespace ReactNative.UIManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using Windows.UI;
#if WINDOWS_UWP
using Windows.UI;
#else
using System.Windows.Media;
#endif

namespace ReactNative.UIManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using System;
using System.Runtime.CompilerServices;
#if WINDOWS_UWP
using Windows.UI.Xaml;
#else
using System.Windows;
#endif
using static System.FormattableString;

namespace ReactNative.UIManager
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@
using System;
using System.Collections.Generic;
using System.Threading;
#if WINDOWS_UWP
using Windows.UI.Xaml.Media;
#else
using System.Windows.Media;
#endif
using static System.FormattableString;

namespace ReactNative.UIManager.Events
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#if WINDOWS_UWP
using Windows.Foundation;
using Windows.UI.Xaml;
#else
using System.Windows;
#endif

namespace ReactNative.UIManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
using Windows.UI.Xaml;
#if WINDOWS_UWP
using Windows.UI.Xaml;
#else
using System.Windows;
#endif

namespace ReactNative.UIManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
using System;
using System.Reactive;
#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Animation;
#else
using System.Windows;
using System.Windows.Media.Animation;
#endif

namespace ReactNative.UIManager.LayoutAnimation
{
Expand Down Expand Up @@ -77,7 +82,11 @@ private Timeline CreateOpacityAnimation(FrameworkElement view, double from, doub
};

Storyboard.SetTarget(timeline, view);
#if WINDOWS_UWP
Storyboard.SetTargetProperty(timeline, "Opacity");
#else
Storyboard.SetTargetProperty(timeline, new PropertyPath("Opacity"));
#endif

return timeline;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
using Newtonsoft.Json.Linq;
using System;
#if WINDOWS_UWP
using Windows.UI.Xaml.Media.Animation;
#else
using System.Windows.Media.Animation;
#endif

namespace ReactNative.UIManager.LayoutAnimation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
using ReactNative.Reflection;
using System;
using System.Reactive;
#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Media.Animation;
#else
using System.Windows;
using System.Windows.Media.Animation;
#endif

namespace ReactNative.UIManager.LayoutAnimation
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@
using System.Reactive.Disposables;
using System.Reactive.Linq;
using System.Runtime.CompilerServices;
#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using System.Windows;
using System.Windows.Controls;
#endif

namespace ReactNative.UIManager.LayoutAnimation
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
using System;
using System.Reactive;
using System.Reactive.Linq;
#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using System.Windows;
using System.Windows.Controls;
#endif

namespace ReactNative.UIManager.LayoutAnimation
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
using System;
using System.Reactive;
#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Media.Animation;
#else
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Animation;
#endif

namespace ReactNative.UIManager.LayoutAnimation
{
Expand Down Expand Up @@ -62,14 +68,18 @@ protected override IObservable<Unit> CreateAnimationCore(FrameworkElement view,
if (currentWidth != dimensions.Width)
{
var timeline = CreateTimeline(view, "Width", currentWidth, dimensions.Width);
#if WINDOWS_UWP
timeline.EnableDependentAnimation = true;
#endif
storyboard.Children.Add(timeline);
}

if (currentHeight != dimensions.Height)
{
var timeline = CreateTimeline(view, "Height", currentHeight, dimensions.Height);
#if WINDOWS_UWP
timeline.EnableDependentAnimation = true;
#endif
storyboard.Children.Add(timeline);
}

Expand All @@ -94,7 +104,11 @@ private DoubleAnimation CreateTimeline(FrameworkElement view, string path, doubl
};

Storyboard.SetTarget(timeline, view);
#if WINDOWS_UWP
Storyboard.SetTargetProperty(timeline, path);
#else
Storyboard.SetTargetProperty(timeline, new PropertyPath(path));
#endif

return timeline;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
using System;
using System.Reactive;
using System.Reactive.Linq;
#if WINDOWS_UWP
using Windows.UI.Xaml.Media.Animation;
#else
using System.Windows.Media.Animation;
#endif

namespace ReactNative.UIManager.LayoutAnimation
{
Expand All @@ -26,8 +30,13 @@ public IDisposable Subscribe(IObserver<Unit> observer)
_storyboard.Begin();

return Observable.FromEventPattern<object>(
#if WINDOWS_UWP
h => _storyboard.Completed += h,
h => _storyboard.Completed -= h)
#else
h => _storyboard.Completed += new EventHandler(h),
h => _storyboard.Completed -= new EventHandler(h))
#endif
.Select(v => default(Unit))
.Finally(() =>
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
using System;
#if WINDOWS_UWP
using Windows.UI.Xaml.Media.Media3D;
#else
using System.Windows.Media.Media3D;
#endif

namespace ReactNative.UIManager
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@
using System.Linq;
using System.Text;
using System.Threading.Tasks;
#if WINDOWS_UWP
using Windows.Foundation;
using Windows.UI.Xaml;
#else
using System.Windows;
#endif

namespace ReactNative.UIManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
using System;
#if WINDOWS_UWP
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
#else
using System.Windows;
using System.Windows.Controls;
#endif

namespace ReactNative.UIManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
using Newtonsoft.Json.Linq;
using System;
using System.Linq;
#if WINDOWS_UWP
using Windows.UI.Xaml.Media.Media3D;
#else
using System.Windows.Media.Media3D;
#endif
using static System.FormattableString;

namespace ReactNative.UIManager
Expand Down
Loading