aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml
blob: 4a804447a77641960a6ba8368e23cf10ee9f1cd7 (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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<UserControl x:Class="Tango.PPC.Common.Controls.TwineCatalogControl"
             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:local="clr-namespace:Tango.PPC.Common.Controls"
             xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI"
             xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
             xmlns:entities="clr-namespace:Tango.BL.Entities;assembly=Tango.BL"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=entities:ColorCatalog, IsDesignTimeCreatable=False}">

    <Grid>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>

            <touch:LightTouchScrollViewer x:Name="scrollViewer" ScrollBarVisibility="Collapsed" >
                <!--<Border Background="White">-->
                <local:TwineCatalogRenderer x:Name="renderer" Groups="{Binding ColorCatalogsGroups}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType={ x:Type local:TwineCatalogControl}},Path=SelectedItem,Mode=TwoWay }"></local:TwineCatalogRenderer>
                <!--</Border>-->
            </touch:LightTouchScrollViewer>

            <!--<touch:TouchListBox ItemsSource="{Binding Groups}" x:Name="list" x:FieldModifier="public" DisableRipple="True" ScrollBarVisibility="Collapsed" SelectionMode="None">
                <touch:TouchListBox.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Margin="0 0 10 0">
                            <TextBlock HorizontalAlignment="Center" Text="{Binding Name,IsAsync=True}" FontSize="{StaticResource TangoTitleFontSize}"></TextBlock>
                            <touch:TouchStaticListBox ItemsSource="{Binding Items,IsAsync=True}" SelectedItem="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SelectedItem,Mode=TwoWay}" Margin="0 20 0 40">
                                <touch:TouchStaticListBox.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <WrapPanel Orientation="Horizontal" />
                                    </ItemsPanelTemplate>
                                </touch:TouchStaticListBox.ItemsPanel>
                                <touch:TouchStaticListBox.ItemContainerStyle>
                                    <Style TargetType="{x:Type touch:TouchStaticListBoxItem}">
                                        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"></Setter>
                                        <Setter Property="RenderTransform">
                                            <Setter.Value>
                                                <ScaleTransform ScaleX="1" ScaleY="1" />
                                            </Setter.Value>
                                        </Setter>
                                        -->
            <!--<Setter Property="Effect">
                                            <Setter.Value>
                                                <DropShadowEffect Color="{StaticResource TangoDarkForegroundColor}" ShadowDepth="0" BlurRadius="20" Opacity="0" />
                                            </Setter.Value>
                                        </Setter>-->
            <!--
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self},Path=IsSelected}" Value="True">
                                                <DataTrigger.EnterActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.5" Duration="00:00:00" />
                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.5" Duration="00:00:00" />
                                                            -->
            <!--<DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="1" Duration="00:00:0.2" />-->
            <!--
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.EnterActions>
                                                <DataTrigger.ExitActions>
                                                    <BeginStoryboard>
                                                        <Storyboard>
                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1" Duration="00:00:00" />
                                                            <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:00" />
                                                            -->
            <!--<DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" />-->
            <!--
                                                        </Storyboard>
                                                    </BeginStoryboard>
                                                </DataTrigger.ExitActions>
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </touch:TouchStaticListBox.ItemContainerStyle>
                                <touch:TouchStaticListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Margin="10" Width="70">
                                            <Ellipse Width="60" Height="60" Fill="{Binding Brush}" />
                                            -->
            <!--<controls:FastTextBlock Margin="0 5 0 0" HorizontalAlignment="Center" Text="{Binding Name,IsAsync=True}"></controls:FastTextBlock>-->
            <!--
                                        </StackPanel>
                                    </DataTemplate>
                                </touch:TouchStaticListBox.ItemTemplate>
                            </touch:TouchStaticListBox>
                        </StackPanel>
                    </DataTemplate>
                </touch:TouchListBox.ItemTemplate>
            </touch:TouchListBox>-->

            <Grid Grid.Column="1"  Margin="30 60 0 20">
                <!--<Rectangle Stroke="{StaticResource TangoDividerBrush}" HorizontalAlignment="Left" />-->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>

                    <Border Width="25" CornerRadius="10">
                        <Border.Clip>
                            <RectangleGeometry RadiusX="10" RadiusY="10">
                                <RectangleGeometry.Rect>
                                    <MultiBinding Converter="{StaticResource WidthHeightToRectConverter}">
                                        <Binding RelativeSource="{RelativeSource AncestorType=Border}" Path="ActualWidth" />
                                        <Binding RelativeSource="{RelativeSource AncestorType=Border}" Path="ActualHeight" />
                                    </MultiBinding>
                                </RectangleGeometry.Rect>
                            </RectangleGeometry>
                        </Border.Clip>
                        <ItemsControl ItemsSource="{Binding ColorCatalogsGroupsOrdered}">
                            <ItemsControl.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <UniformGrid Columns="1" />
                                </ItemsPanelTemplate>
                            </ItemsControl.ItemsPanel>
                            <ItemsControl.ItemTemplate>
                                <DataTemplate>
                                    <Rectangle>
                                        <Rectangle.Fill>
                                            <SolidColorBrush Color="{Binding Color}" />
                                        </Rectangle.Fill>
                                    </Rectangle>
                                </DataTemplate>
                            </ItemsControl.ItemTemplate>
                        </ItemsControl>
                    </Border>

                    <Grid Grid.Column="1" >
                        <touch:TouchSlider x:Name="slider"  ValueChanged="TouchSlider_ValueChanged" IsSnapToTickEnabled="True" Minimum="0" Maximum="{Binding ColorCatalogsGroups.Count,Converter={StaticResource MathOperatorConverter},ConverterParameter='-1'}" Orientation="Vertical" Width="40" Height="Auto" IsSelectionRangeEnabled="False">
                            <touch:TouchSlider.ThumbTemplate>
                                <ControlTemplate>
                                    <touch:TouchIcon Foreground="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchSlider},Path=Foreground}" Width="40" Height="40" Icon="Water" Angle="-90" />
                                </ControlTemplate>
                            </touch:TouchSlider.ThumbTemplate>
                        </touch:TouchSlider>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</UserControl>