blob: 0d6faa092159601ab76e802cbc3812c289dc69df (
plain)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
<UserControl x:Class="Tango.PPC.Jobs.Dialogs.FineTuningPaletteView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
xmlns:hive="clr-namespace:Tango.Hive;assembly=Tango.Hive"
xmlns:local="clr-namespace:Tango.PPC.Jobs.Dialogs"
mc:Ignorable="d"
d:DesignHeight="800" d:DesignWidth="600" Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DataContext="{d:DesignInstance Type=local:FineTuningPaletteViewVM, IsDesignTimeCreatable=False}">
<Grid>
<DockPanel Margin="20">
<StackPanel DockPanel.Dock="Top">
<TextBlock FontSize="{StaticResource TangoMessageBoxTitleFontSize}">Fine Tuning Palette</TextBlock>
<TextBlock Margin="0 30 0 0">Choose fine tuning palette:</TextBlock>
<touch:TouchFlatListBox Margin="50 40 50 0" ItemsSource="{Binding Suggestions}" SelectedItem="{Binding SelectedSuggestion}" IsEnabled="False">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="{Binding Suggestions.Count}"></UniformGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Width="70" Height="70" Margin="50 0">
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Content">
<Setter.Value>
<Ellipse Width="70" Height="70" Fill="{Binding Brush}" HorizontalAlignment="Center">
</Ellipse>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected}" Value="True">
<Setter Property="Content">
<Setter.Value>
<Grid>
<Ellipse Fill="{Binding Brush}" Width="60" Height="60"></Ellipse>
<Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" Margin="-1" StrokeThickness="3" StrokeDashArray="2" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}"></Ellipse>
</Grid>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
</touch:TouchFlatListBox>
<ItemsControl Margin="0 40 0 0" ItemsSource="{Binding Suggestions}" Height="20">
<ItemsControl.Clip>
<RectangleGeometry RadiusX="10" RadiusY="10">
<RectangleGeometry.Rect>
<MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
<Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualWidth"></Binding>
<Binding RelativeSource="{RelativeSource AncestorType=ItemsControl}" Path="ActualHeight"></Binding>
</MultiBinding>
</RectangleGeometry.Rect>
</RectangleGeometry>
</ItemsControl.Clip>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="{Binding Suggestions.Count}"></UniformGrid>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Rectangle Fill="{Binding Brush}"></Rectangle>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</StackPanel>
<DockPanel DockPanel.Dock="Bottom" LastChildFill="False">
<touch:TouchButton DockPanel.Dock="Left" Command="{Binding CloseCommand}" CornerRadius="25" Style="{StaticResource TangoHollowButton}" Width="170" Height="50">
CANCEL
</touch:TouchButton>
<touch:TouchButton DockPanel.Dock="Right" Command="{Binding OKCommand}" CornerRadius="25" Style="{StaticResource TangoHollowButton}" Width="170" Height="50">
OK
</touch:TouchButton>
</DockPanel>
<hive:HexList Width="330" Height="460" Margin="0 40 0 0" RowCount="6" ColumnCount="5" ItemsSource="{Binding HiveSuggestions}" SelectedItem="{Binding SelectedHiveSuggestion,Mode=TwoWay}">
<hive:HexList.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"></Setter>
<Setter Property="VerticalContentAlignment" Value="Stretch"></Setter>
<Setter Property="Background" Value="Transparent"></Setter>
<Setter Property="Grid.Column" Value="{Binding Path=Column}"></Setter>
<Setter Property="Grid.Row" Value="{Binding Path=Row}"></Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Grid Margin="10">
<Ellipse Fill="{Binding Brush}"></Ellipse>
<Ellipse Stroke="{StaticResource TangoDarkForegroundBrush}" Margin="-4" StrokeThickness="3" StrokeDashArray="2" Visibility="{Binding RelativeSource={RelativeSource AncestorType=ListBoxItem},Path=IsSelected,Converter={StaticResource BooleanToVisibilityConverter}}"></Ellipse>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</hive:HexList.ItemContainerStyle>
</hive:HexList>
</DockPanel>
</Grid>
</UserControl>
|