Skip to content
Brandon edited this page Feb 7, 2018 · 12 revisions

Welcome to the CSDeskBand wiki!

Getting Started

These are quick setup guides to get you started. You can decide whether to create your Deskband with Winforms or Wpf.

Project Setup

Winforms project setup

  • Create a new Winforms Control project in Visual Studio
  • Add the CSDeskBand.Win Nuget package
  • Make your control inherit from CSDeskBandWin
    public partial class UserControl1: CSDeskBandWin
    {
        public UserControl1()
        {
            InitializeComponent();
        }
    }

Wpf project setup

  • Create a new Wpf User Control project in Visual Studio
  • Add the CSDeskBand.Wpf Nuget package
  • Make the control inherit from CSDeskBandWpf
<deskband:CSDeskBandWpf x:Class="WpfControlLibrary1.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:WpfControlLibrary1"
             xmlns:deskband="clr-namespace:CSDeskBand.Wpf;assembly=CSDeskBand.Wpf" <!-- Reference the assembly -->
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
    <Grid>
            
    </Grid>
</deskband:CSDeskBandWpf>

Attributes

There are 3 attributes that need to be added to your deskband class

  • [ComVisible(true)]
  • [Guid("F61EF213-351A-4EAA-82C8-CB9221AC8ABB")]
  • [CSDeskBandRegistration(Name = "Sample Deskband")]
    [ComVisible(true)]
    [Guid("F61EF213-351A-4EAA-82C8-CB9221AC8ABB")]
    [CSDeskBandRegistration(Name = "Sample Deskband")]
    public partial class UserControl1
    {
        public UserControl1()
        {
            InitializeComponent();
        }
    }

Usage

Deskband Options

Deskband Installation

You need to start an elevated command prompt and be able to use regasm.exe An easy way to do this is use the Developer Command Prompt for Visual Studio. Make sure that you use the correct version of regasm that matches your platform.

cd Sample.Win\bin\Debug

regasm /codebase Sample.Win.dll

The /codebase switch will add the path of the dll into the registry entry.

Alternatively, register the assemblies into the Global Assembly Cache.

gacutil -i CSDeskBand.dll
gacutil -i CSDeskBand.Win.dll
gacutil -i Sample.Win.dll
regasm Sample.Win.dll

Note that GAC installation requires the assemblies to be Strong-Named

Clone this wiki locally