MultiSelect for UWP
外観
機能 > 外観

MultiSelect allows you to customize the appearance of all the individual elements of the control and manage its overall appearance.

Apply Styles to C1MultiSelect

The following image shows styles applied to C1MultiSelect.

To apply style to MultiSelect using System.Windows.Style class, use the following code.

In code

C#
コードのコピー
Style s = new Style(typeof(C1MultiSelect));
s.Setters.Add(new Setter(ItemsControl.BackgroundProperty, new SolidColorBrush(Colors.BurlyWood)));
mselect.Style = s;
Back to Top

Apply Styles to Tags

The following image shows styles applied to the tags in MultiSelect.

To customize the appearance of tags of C1MultiSelect, use the following code. Tags styles in C1MultiSelect can be accessed via the TagStyle property.

In code

C#
コードのコピー
Style ts = new Style(typeof(C1Tag));
ts.Setters.Add(new Setter(ItemsControl.ForegroundProperty, new SolidColorBrush(Colors.Brown)));
mselect.TagStyle = ts;
Back to Top

C#
コードのコピー
Style cs = new Style(typeof(C1CheckListItem));
cs.Setters.Add(new Setter(ItemsControl.BackgroundProperty,
               new SolidColorBrush(Color.FromRgb(240, 248, 255))));
mselect.ItemContainerStyle = cs;

XAML
コードのコピー
<Setter Property="Foreground" Value="#F0F8FF" />
     </Style> 
</Window.Resources> 
<Grid> 
    <c1:C1MultiSelect x:Name="mselect" ShowDropDownButton="true" HorizontalAlignment="Left"
        Margin="9,35,0,0" VerticalAlignment="Top" Width="270" TagStyle="{StaticResource StyleForTag}" />
</Grid>