Skip to content

xCAD framework allows to add custom Windows Forms controls and WPF controls into Task Pane View.

Decorate the control classes with TitleAttribute and IconAttribute to assign tooltip and icon.

Simple Task Pane

Taskpane can be created by calling the method below. Pointer to IXTaskPane provides an access to underlying properties and the pointer to the created control.

cs
var taskPane = CreateTaskPane<WinFormControl>();
WinFormControl control = taskPane.Control;

Commands Task Pane

Custom controls rendered in Task Pane

Additionally task pane can contain custom command buttons.

cs
public enum TaskPaneCommands_e
{
    [Title("Task Pane Command")]
    [Icon(typeof(Resources), nameof(Resources.command1))]
    Command,

    [TaskPaneStandardIcon(TaskPaneStandardIcons_e.Close)]
    Close
}

private IXTaskPane<WpfControl> m_TaskPane;
cs
var cmdTaskPane = this.CreateTaskPane<WpfControl, TaskPaneCommands_e>();
cmdTaskPane.ButtonClick += OnTaskPaneButtonClick;
m_TaskPane = cmdTaskPane;
cs
private void OnTaskPaneButtonClick(TaskPaneCommands_e spec)
{
    switch (spec)
    {
        case TaskPaneCommands_e.Command:
            //handle command
            break;

        case TaskPaneCommands_e.Close:
            m_TaskPane.Close();
            break;
    }
}