ComponentOne Input Library for WPF
Input Library Overview / Multiselect / Quick Start
In This Topic
    Quick Start
    In This Topic

    This quick start is intended to get you up and running with the TagEditor control. It guides you through the steps of adding the MultiSelect control to a project and binding it to a data source.

    The following image shows how the MultiSelect control appears after data binding.

    MultiSelect for WPF control

    Set up the Application

    1. Create a new WPF App in Visual Studio.
    2. In the Solution Explorer, right click Dependencies and select Manage NuGet Packages.
    3. In NuGet Package Manager, select nuget.org as the Package source.
    4. Search and select the following package and click Install.
      • C1.WPF.Input

    Back to Top

    Adding MultiSelect control to the Application

    1. In XAML Design, drag and drop the C1MultiSelect control from the toolbox onto the window.
    2. In the XAML code, add the following namespace in the <Window></Window> tag.
      XAML
      Copy Code
      xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
      
    3. Set the Name property for the MultiSelect control along with the desired height and width to make the code looks similar to the following.
      XAML
      Copy Code
      <c1:C1MultiSelect x:Name="mselect" Height="100" Width="300"></c1:C1MultiSelect>
      

    Back to Top

    Binding MultiSelect to a list

    1. In the Properties window, navigate to the Window_Loaded event and double click to create it for the window.
    2. Switch to the code view and add following code to Window_Loaded event.
      C#
      Copy Code
      IList<string> addressBook = new List<string>()
      {
          "John Doe <john.doe@hotmail.com>",
          "Nancy Simmons <nsimmons@gmail.com>",
          "Henry Crews <crewsrulez@ezmail.com>",
          "Patrick Smith <psmith1988@mail.ru>",
          "Carl Collins <cc1964@facebook.com>",
          "Melody Pond <riversong@ezmail.com>",
          "Rory Williams <rorywilliams1@yandex.ru>",
          "Tracy Hobs <hobhob@protonmail.com>",
          "Sam Powell <sam.powell@ezmail.com>",
          "Charlotte Marsh <c.marsh1998@yandex.ru>",
          "Amy Berry <amyberry@mail.ru>",
          Dante Adams <d.adams@hotmail.com>",
          "Derrick Skinner <skinner487@protonmail.com>",
          "Christina Fallon <christina.wonder@hotmail.com>",
          "Adam Johnson <johnson.adam@yahoo.com>"
      };
      
      mselect.ItemsSource = addressBook;
      

    Back to Top

    Build and Run the Project

    1. Click Build | Build Solution to build the project.
    2. Press F5 to run the project.

    Back to Top