1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:local="clr-namespace:Tango.Explorer">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Resources/Colors.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Resources/Fonts.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/Shared.xaml"/>
</ResourceDictionary.MergedDictionaries>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<Style TargetType="{x:Type local:ExplorerControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:ExplorerControl}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<touch:TouchListBox x:Name="PART_ListBox"
IsMultiSelecting="{Binding RelativeSource={RelativeSource AncestorType=local:ExplorerControl},Path=IsMultiSelecting,Mode=OneWayToSource}"
ItemsSource="{Binding RelativeSource={RelativeSource AncestorType=local:ExplorerControl},Path=CurrentFolder.Items}"
SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=local:ExplorerControl},Path=SelectedItem,Mode=TwoWay}"
SelectedItems="{Binding RelativeSource={RelativeSource AncestorType=local:ExplorerControl},Path=SelectedItems,Mode=TwoWay}">
<touch:TouchListBox.Style>
<Style TargetType="touch:TouchListBox" BasedOn="{StaticResource {x:Type touch:TouchListBox}}">
<Setter Property="SelectionMode" Value="None"></Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:ExplorerControl},Path=EnableMultiSelect}" Value="True">
<Setter Property="SelectionMode" Value="Multiple"></Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</touch:TouchListBox.Style>
<touch:TouchListBox.ItemTemplate>
<DataTemplate DataType="local:ExplorerItem">
<Border Padding="8" BorderBrush="#E9E9E9" BorderThickness="0 0 0 1">
<Grid>
<DockPanel>
<Image DockPanel.Dock="Left" Source="{Binding Icon}" Width="50" Height="50" />
<StackPanel VerticalAlignment="Center" Margin="20 0 0 0">
<TextBlock FontSize="16" Text="{Binding Name}"></TextBlock>
<TextBlock Opacity="0.5" FontSize="12" Margin="0 5 0 0" Text="{Binding Description}"></TextBlock>
</StackPanel>
</DockPanel>
<Grid HorizontalAlignment="Right" VerticalAlignment="Center" Visibility="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchListBox},Path=IsMultiSelecting,Converter={StaticResource BooleanToVisibilityConverter}}">
<touch:TouchIcon
Icon="CheckCircleOutline"
Foreground="{StaticResource TangoPrimaryAccentBrush}"
Width="20"
Height="20"
Visibility="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}"/>
</Grid>
</Grid>
</Border>
</DataTemplate>
</touch:TouchListBox.ItemTemplate>
</touch:TouchListBox>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
|