Example #1
0
        public static void AttachAndOpenTool <T>(this FrameworkElement frameworkElement, object parameter = null)
            where T : class, IControlTool
        {
            Argument.IsNotNull(() => frameworkElement);

            frameworkElement?.AttachTool <T>()?.Open(parameter);
        }
Example #2
0
        public static T AttachTool <T>(this FrameworkElement frameworkElement)
            where T : class, IControlTool
        {
            Argument.IsNotNull(() => frameworkElement);

            return(frameworkElement.AttachTool(typeof(T)) as T);
        }
Example #3
0
        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);
        }