예제 #1
0
        /// <summary>
        /// Binds the command visual's tool tip property to tool tip description using a Cocoa binding.
        /// </summary>
        /// <param name="visualCommand">The <see cref="VisualRelayCommand"/> whose <see cref="VisualRelayCommand.ToolTipDescription"/> is bound to.</param>
        /// <param name="commandVisual">The visual associated with <paramref name="visualCommand"/>.</param>
        /// <remarks>To avoid retention-related leaks, be sure to call <see cref="UnbindCommandVisualFromToolTipDescription(NSView)"/> when the command visual is no longer needed.</remarks>
        public static void BindCommandVisualToToolTipDescription(this VisualRelayCommand visualCommand, NSView commandVisual)
        {
            var toolTip = new NSString("toolTip");

            commandVisual.Bind(toolTip, visualCommand, "ToolTipDescription", null);
        }