diff --git a/ReactWindows/ReactNative.Net46/ReactPage.cs b/ReactWindows/ReactNative.Net46/ReactPage.cs
index 83ccf33fa8c..65a44b6d1cc 100644
--- a/ReactWindows/ReactNative.Net46/ReactPage.cs
+++ b/ReactWindows/ReactNative.Net46/ReactPage.cs
@@ -156,7 +156,7 @@ public void OnResume(Action onBackPressed)
///
public async Task DisposeAsync()
{
- RootView?.RemoveHandler(Keyboard.KeyDownEvent, (KeyEventHandler) OnAcceleratorKeyActivated);
+ RootView?.RemoveHandler(Keyboard.KeyDownEvent, (KeyEventHandler)OnAcceleratorKeyActivated);
if (_reactInstanceManager.IsValueCreated)
{
diff --git a/ReactWindows/ReactNative.Net46/UIManager/UIManagerModule.cs b/ReactWindows/ReactNative.Net46/UIManager/UIManagerModule.cs
index 0748c6f5ac0..2ce2a7a8020 100644
--- a/ReactWindows/ReactNative.Net46/UIManager/UIManagerModule.cs
+++ b/ReactWindows/ReactNative.Net46/UIManager/UIManagerModule.cs
@@ -137,7 +137,17 @@ public int AddMeasuredRootView(SizeMonitoringCanvas rootView)
return tag;
}
-#region React Methods
+ ///
+ /// Schedule a block to be executed on the UI thread. Useful if you need to execute
+ /// view logic after all currently queued view updates have completed.
+ ///
+ /// The UI block.
+ public void AddUIBlock(IUIBlock block)
+ {
+ _uiImplementation.AddUIBlock(block);
+ }
+
+ #region React Methods
///
/// Removes the root view.
diff --git a/ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems b/ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems
index 19cd176d235..7f2468883e7 100644
--- a/ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems
+++ b/ReactWindows/ReactNative.Shared/ReactNative.Shared.projitems
@@ -150,6 +150,7 @@
+
diff --git a/ReactWindows/ReactNative.Shared/UIManager/IUIBlock.cs b/ReactWindows/ReactNative.Shared/UIManager/IUIBlock.cs
new file mode 100644
index 00000000000..450b2de0927
--- /dev/null
+++ b/ReactWindows/ReactNative.Shared/UIManager/IUIBlock.cs
@@ -0,0 +1,17 @@
+using ReactNative.UIManager;
+
+namespace ReactNative.UIManager
+{
+ ///
+ /// Interface that represents a block to execute on the UI thread.
+ /// Exposes NativeViewHierarchyManager for third party libraries.
+ ///
+ public interface IUIBlock
+ {
+ ///
+ /// Executes the block.
+ ///
+ /// The native view hierarchy manager.
+ void Execute(NativeViewHierarchyManager nativeViewHierarchyManager);
+ }
+}
\ No newline at end of file
diff --git a/ReactWindows/ReactNative.Shared/UIManager/NativeViewHierarchyManager.cs b/ReactWindows/ReactNative.Shared/UIManager/NativeViewHierarchyManager.cs
index f2b957dc6dd..fb8d5790736 100644
--- a/ReactWindows/ReactNative.Shared/UIManager/NativeViewHierarchyManager.cs
+++ b/ReactWindows/ReactNative.Shared/UIManager/NativeViewHierarchyManager.cs
@@ -575,7 +575,11 @@ public void ShowPopupMenu(int tag, string[] items, ICallback success)
throw new NotImplementedException();
}
- private DependencyObject ResolveView(int tag)
+ ///
+ /// Resolves a view.
+ ///
+ /// The tag of the view.
+ public DependencyObject ResolveView(int tag)
{
var view = default(DependencyObject);
if (!_tagsToViews.TryGetValue(tag, out view))
@@ -587,7 +591,11 @@ private DependencyObject ResolveView(int tag)
return view;
}
- private IViewManager ResolveViewManager(int tag)
+ ///
+ /// Resolves a view's view manager.
+ ///
+ /// The tag of the view.
+ public IViewManager ResolveViewManager(int tag)
{
var viewManager = default(IViewManager);
if (!_tagsToViewManagers.TryGetValue(tag, out viewManager))
diff --git a/ReactWindows/ReactNative.Shared/UIManager/UIImplementation.cs b/ReactWindows/ReactNative.Shared/UIManager/UIImplementation.cs
index b66f154efad..418200cf990 100644
--- a/ReactWindows/ReactNative.Shared/UIManager/UIImplementation.cs
+++ b/ReactWindows/ReactNative.Shared/UIManager/UIImplementation.cs
@@ -623,6 +623,15 @@ public void ShowPopupMenu(int reactTag, string[] items, ICallback error, ICallba
_operationsQueue.EnqueueShowPopupMenu(reactTag, items, error, success);
}
+ ///
+ /// Enqueues UIBlock to be executed.
+ ///
+ /// The UI block.
+ public void AddUIBlock(IUIBlock block)
+ {
+ _operationsQueue.EnqueueUIBlock(block);
+ }
+
///
/// Called when the host receives the suspend event.
///
diff --git a/ReactWindows/ReactNative.Shared/UIManager/UIViewOperationQueue.cs b/ReactWindows/ReactNative.Shared/UIManager/UIViewOperationQueue.cs
index d912f2a0a9e..a362554d027 100644
--- a/ReactWindows/ReactNative.Shared/UIManager/UIViewOperationQueue.cs
+++ b/ReactWindows/ReactNative.Shared/UIManager/UIViewOperationQueue.cs
@@ -164,6 +164,15 @@ public void EnqueueShowPopupMenu(int tag, string[] items, ICallback error, ICall
EnqueueOperation(() => _nativeViewHierarchyManager.ShowPopupMenu(tag, items, success));
}
+ ///
+ /// Enqueues a operation to execute a UIBlock.
+ ///
+ /// The UI block.
+ public void EnqueueUIBlock(IUIBlock block)
+ {
+ EnqueueOperation(() => block.Execute(_nativeViewHierarchyManager));
+ }
+
///
/// Enqueues an operation to create a view.
///
diff --git a/ReactWindows/ReactNative/UIManager/UIManagerModule.cs b/ReactWindows/ReactNative/UIManager/UIManagerModule.cs
index 6718f199eb8..5cf9adaee0c 100644
--- a/ReactWindows/ReactNative/UIManager/UIManagerModule.cs
+++ b/ReactWindows/ReactNative/UIManager/UIManagerModule.cs
@@ -132,7 +132,17 @@ public int AddMeasuredRootView(SizeMonitoringCanvas rootView)
return tag;
}
-#region React Methods
+ ///
+ /// Schedule a block to be executed on the UI thread. Useful if you need to execute
+ /// view logic after all currently queued view updates have completed.
+ ///
+ /// The UI block.
+ public void AddUIBlock(IUIBlock block)
+ {
+ _uiImplementation.AddUIBlock(block);
+ }
+
+ #region React Methods
///
/// Removes the root view.