123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:fw="clr-namespace:FWindSoft.Wpf.Controls">
- <Style x:Key="{ComponentResourceKey
- TypeInTargetAssembly={x:Type fw:ImageView},
- ResourceId=DefaultStyle}"
- TargetType="{x:Type ListView}"
- BasedOn="{StaticResource {x:Type ListBox}}"
- >
- <Setter Property="ItemsPanel">
- <Setter.Value>
- <ItemsPanelTemplate>
- <WrapPanel Width="{Binding (FrameworkElement.ActualWidth),
- RelativeSource={RelativeSource
- AncestorType=ScrollContentPresenter}}"
- ItemWidth="{Binding (ListView.View).ItemWidth,
- RelativeSource={RelativeSource AncestorType=ListView}}"
- MinWidth="{Binding ItemWidth,
- RelativeSource={RelativeSource Self}}"
- ItemHeight="{Binding (ListView.View).ItemHeight,
- RelativeSource={RelativeSource AncestorType=ListView}}"/>
- </ItemsPanelTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="{ComponentResourceKey TypeInTargetAssembly=
- {x:Type fw:ImageView},
- ResourceId=ItemContainerDefaultStyle}"
- TargetType="{x:Type ListViewItem}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="HorizontalContentAlignment" Value="Center" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="0"/>
- <Setter Property="Margin" Value="1"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListViewItem}">
- <Border x:Name="Border" Margin="2,1,2,1" BorderThickness="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
- Background="AliceBlue" OpacityMask="#FF61E4E4">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="*"></RowDefinition>
- <RowDefinition Height="Auto"></RowDefinition>
- </Grid.RowDefinitions>
- <Image Margin="1" Cursor="Hand" Stretch="Fill" HorizontalAlignment="Center" Source="{Binding Path=(fw:ImageView.Image),Mode=OneWay,RelativeSource={RelativeSource TemplatedParent}}" >
- <Image.ToolTip >
- <TextBlock Text="{Binding Path=(fw:ImageView.ToolTip),Mode=OneWay,RelativeSource={RelativeSource TemplatedParent}}" />
- </Image.ToolTip>
- </Image>
- <TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Row="1" Text="{Binding Path=(fw:ImageView.Display),Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" />
- </Grid>
-
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsFocused" Value="True">
- <Setter Property="BorderBrush" Value="#1DE5E5" TargetName="Border" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="BorderBrush" Value="#77E8E8" TargetName="Border" />
- </Trigger>
- <Trigger Property="IsFocused" Value="False">
- <Setter Property="BorderBrush" Value="#1DE5E5" TargetName="Border" />
- </Trigger>
- <Trigger Property="IsSelected" Value="False">
- <Setter Property="BorderBrush" Value="#919191" TargetName="Border" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|