1234567891011121314151617181920212223242526272829303132333435 |
- <UserControl x:Class="FWindSoft.Wpf.Controls.ListCategory"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:controls="clr-namespace:FWindSoft.Wpf.Controls"
- x:Name="this" Height="{Binding Height, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}" Width="{Binding Width, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UIElement}}">
- <Grid>
- <ListBox Margin="0,0,0,0" Name="list" Grid.Row="0" Grid.Column="0" BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="True">
- <ListBox.ItemsPanel >
- <ItemsPanelTemplate>
- <WrapPanel Orientation="Vertical" Height="{Binding ElementName=list,Path=Height}"></WrapPanel>
- </ItemsPanelTemplate>
- </ListBox.ItemsPanel>
- <ListBox.ItemContainerStyle>
- <Style TargetType="{x:Type ListBoxItem}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Border" Margin="2,1,2,1" BorderThickness="2" VerticalAlignment="Center"
- Background="AliceBlue" OpacityMask="#FF61E4E4">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto"></ColumnDefinition>
- </Grid.ColumnDefinitions>
- <CheckBox Content="{Binding Display}" IsChecked="{Binding IsChecked,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}" Command="{x:Static controls:ListCategory.SelectCommand}"></CheckBox>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ListBox.ItemContainerStyle>
- </ListBox>
- </Grid>
- </UserControl>
|