public static void SetResizeGripDirection(IInputElement inputElement, ResizeGripDirection direction)
{
Verify.IsNotNull(inputElement, "inputElement");
var dobj = inputElement as DependencyObject;
if (dobj == null)
{
throw new ArgumentException("The element must be a DependencyObject", "inputElement");
}
dobj.SetValue(ResizeGripDirectionProperty, direction);
}