aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common
diff options
context:
space:
mode:
authorShlomo Hecht <shlomo@twine-s.com>2018-07-02 13:54:10 +0300
committerShlomo Hecht <shlomo@twine-s.com>2018-07-02 13:54:10 +0300
commit2dfca3d422f3537e3685d06906472f704e2eeb10 (patch)
tree19f5e6c115df6301e251a2febe940e80727a34e2 /Software/Visual_Studio/PPC/Tango.PPC.Common
parentb1de1d1f0a74cb1c2541e972c802fd967ec59e0a (diff)
parent57d2810dae9d6d40c52ec33508a324582ac3113b (diff)
downloadTango-2dfca3d422f3537e3685d06906472f704e2eeb10.tar.gz
Tango-2dfca3d422f3537e3685d06906472f704e2eeb10.zip
Merge branch 'master' of https://twinetfs.visualstudio.com/_git/Tango
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml94
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs46
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml2
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj7
4 files changed, 148 insertions, 1 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml
new file mode 100644
index 000000000..142e1a10c
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml
@@ -0,0 +1,94 @@
+<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:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch"
+ xmlns:catalog="clr-namespace:Tango.BL.Catalogs;assembly=Tango.BL"
+ mc:Ignorable="d"
+ d:DesignHeight="300" Background="White" d:DesignWidth="300" d:DataContext="{d:DesignInstance Type=catalog:Catalog, IsDesignTimeCreatable=False}">
+
+ <Grid>
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="100"/>
+ </Grid.ColumnDefinitions>
+
+ <touch:TouchListBox ItemsSource="{Binding Groups}" x:Name="list">
+ <touch:TouchListBox.ItemTemplate>
+ <DataTemplate>
+ <StackPanel>
+ <TextBlock HorizontalAlignment="Center" Text="{Binding Name}"></TextBlock>
+ <ItemsControl ItemsSource="{Binding Items}" Margin="0 20 0 40">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <WrapPanel Orientation="Horizontal" />
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <StackPanel Margin="10">
+ <Ellipse Width="60" Height="60" Fill="{Binding Brush}" />
+ <TextBlock Margin="0 5 0 0" HorizontalAlignment="Center" Text="{Binding Name}"></TextBlock>
+ </StackPanel>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </StackPanel>
+ </DataTemplate>
+ </touch:TouchListBox.ItemTemplate>
+ </touch:TouchListBox>
+
+ <Grid Grid.Column="1">
+ <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 Groups}">
+ <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 ValueChanged="TouchSlider_ValueChanged" IsSnapToTickEnabled="True" Minimum="0" Maximum="{Binding Groups.Count,Converter={StaticResource MathOperatorConverter},ConverterParameter='-1'}" Orientation="Vertical" Width="40" Height="Auto" IsSelectionRangeEnabled="False">
+ <touch:TouchSlider.ThumbTemplate>
+ <ControlTemplate>
+ <touch:TouchIcon Width="40" Height="40" Icon="Water" Angle="-90" />
+ </ControlTemplate>
+ </touch:TouchSlider.ThumbTemplate>
+ </touch:TouchSlider>
+ </Grid>
+ </Grid>
+ </Grid>
+ </Grid>
+ </Grid>
+</UserControl>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs
new file mode 100644
index 000000000..ad1c8b50c
--- /dev/null
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogControl.xaml.cs
@@ -0,0 +1,46 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Tango.BL.Catalogs;
+
+namespace Tango.PPC.Common.Controls
+{
+ /// <summary>
+ /// Interaction logic for TwineCatalogControl.xaml
+ /// </summary>
+ public partial class TwineCatalogControl : UserControl
+ {
+ private Catalog _catalog;
+
+ public TwineCatalogControl()
+ {
+ InitializeComponent();
+ Loaded += TwineCatalogControl_Loaded;
+ DataContextChanged += (x, y) => { _catalog = DataContext as Catalog; };
+ }
+
+ private void TwineCatalogControl_Loaded(object sender, RoutedEventArgs e)
+ {
+
+ }
+
+ private void TouchSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+ {
+ if (_catalog != null)
+ {
+ list.ScrollToItem(_catalog.Groups.ElementAt(_catalog.Groups.Count - 1 - (int)e.NewValue));
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml
index e28234573..a6e2cbec2 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml
@@ -34,7 +34,7 @@
<converters:WidthHeightToRectConverter x:Key="WidthHeightToRectConverter" />
<converters:OneToPercentConverter x:Key="OneToPercentConverter" />
<converters:SmallerThanToBooleanConverter x:Key="SmallerThanToBooleanConverter" />
-
+
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
index 82bed24e6..98210a76f 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Tango.PPC.Common.csproj
@@ -92,6 +92,9 @@
<Compile Include="..\..\Versioning\PPC.cs">
<Link>PPC.cs</Link>
</Compile>
+ <Compile Include="Controls\TwineCatalogControl.xaml.cs">
+ <DependentUpon>TwineCatalogControl.xaml</DependentUpon>
+ </Compile>
<Compile Include="IPPCView.cs" />
<Compile Include="Modules\IPPCModuleLoader.cs" />
<Compile Include="Navigation\INavigationBlocker.cs" />
@@ -103,6 +106,10 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
+ <Page Include="Controls\TwineCatalogControl.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Resources\Colors.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>