diff --git a/Perspex.Controls/Control.cs b/Perspex.Controls/Control.cs
index 41dcb6aab1..7cc3545838 100644
--- a/Perspex.Controls/Control.cs
+++ b/Perspex.Controls/Control.cs
@@ -300,30 +300,6 @@ namespace Perspex.Controls
}
}
- ///
- /// Tries to being the control into view.
- ///
- public void BringIntoView()
- {
- this.BringIntoView(new Rect(this.Bounds.Size));
- }
-
- ///
- /// Tries to being the specified area on the control into view.
- ///
- /// The area of the control to being into view.
- public void BringIntoView(Rect rect)
- {
- var ev = new RequestBringIntoViewEventArgs
- {
- RoutedEvent = RequestBringIntoViewEvent,
- TargetObject = this,
- TargetRect = rect,
- };
-
- this.RaiseEvent(ev);
- }
-
///
/// Sets the control's logical parent.
///
diff --git a/Perspex.Controls/ControlExtensions.cs b/Perspex.Controls/ControlExtensions.cs
index cb13407701..d490708573 100644
--- a/Perspex.Controls/ControlExtensions.cs
+++ b/Perspex.Controls/ControlExtensions.cs
@@ -6,18 +6,49 @@
namespace Perspex.Controls
{
- using System;
- using System.Collections.Generic;
using System.Linq;
- using Perspex.Controls;
- using Perspex.Controls.Primitives;
using Perspex.LogicalTree;
using Perspex.Styling;
- using Perspex.VisualTree;
+ ///
+ /// Adds common functionality to .
+ ///
public static class ControlExtensions
{
- public static T FindControl(this Control control, string name) where T : Control
+ ///
+ /// Tries to being the control into view.
+ ///
+ /// The control.
+ public static void BringIntoView(this IControl control)
+ {
+ control.BringIntoView(new Rect(control.Bounds.Size));
+ }
+
+ ///
+ /// Tries to being the control into view.
+ ///
+ /// The control.
+ /// The area of the control to being into view.
+ public static void BringIntoView(this IControl control, Rect rect)
+ {
+ var ev = new RequestBringIntoViewEventArgs
+ {
+ RoutedEvent = Control.RequestBringIntoViewEvent,
+ TargetObject = control,
+ TargetRect = rect,
+ };
+
+ control.RaiseEvent(ev);
+ }
+
+ ///
+ /// Finds the named control in the specified control.
+ ///
+ /// The type of the control to find.
+ /// The control.
+ /// The name of the control to find.
+ /// The control or null if not found.
+ public static T FindControl(this IControl control, string name) where T : IControl
{
return control.GetLogicalDescendents()
.OfType()
diff --git a/Perspex.Controls/MenuItem.cs b/Perspex.Controls/MenuItem.cs
index e539c1dea3..72bee4959f 100644
--- a/Perspex.Controls/MenuItem.cs
+++ b/Perspex.Controls/MenuItem.cs
@@ -8,6 +8,7 @@ namespace Perspex.Controls
{
using System;
using System.Collections.Generic;
+ using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Windows.Input;
using Perspex.Controls.Mixins;
@@ -73,6 +74,15 @@ namespace Perspex.Controls
public static readonly RoutedEvent SubmenuOpenedEvent =
RoutedEvent.Register