public static void AttachAndOpenTool <T>(this FrameworkElement frameworkElement, object parameter = null) where T : class, IControlTool { Argument.IsNotNull(() => frameworkElement); frameworkElement?.AttachTool <T>()?.Open(parameter); }
public static T AttachTool <T>(this FrameworkElement frameworkElement) where T : class, IControlTool { Argument.IsNotNull(() => frameworkElement); return(frameworkElement.AttachTool(typeof(T)) as T); }
public static void AttachAndOpenTool(this FrameworkElement frameworkElement, Type toolType, object parameter = null) { Argument.IsNotNull(() => frameworkElement); Argument.IsNotNull(() => toolType); var tool = frameworkElement.AttachTool(toolType) as IControlTool; tool?.Open(parameter); }