diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-07-01 09:09:55 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-07-01 09:09:55 +0300 |
| commit | be014619f075a3ff76e03487014212234955f322 (patch) | |
| tree | 8e4e387dfeb5e4f51cc60461f47812451dac950a /Software/Visual_Studio | |
| parent | 1303ac651e1990447612e139d02d5844c05fb31c (diff) | |
| download | Tango-be014619f075a3ff76e03487014212234955f322.tar.gz Tango-be014619f075a3ff76e03487014212234955f322.zip | |
Working on PPC color conversion UI.
Diffstat (limited to 'Software/Visual_Studio')
13 files changed, 332 insertions, 10 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml index 404ef7560..ccbcc8394 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionView.xaml @@ -4,14 +4,95 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:local="clr-namespace:Tango.PPC.Jobs.Dialogs" + xmlns:models="clr-namespace:Tango.PPC.Jobs.Models" + xmlns:pmr="clr-namespace:Tango.PMR.ColorLab;assembly=Tango.PMR" xmlns:touch="clr-namespace:Tango.Touch.Controls;assembly=Tango.Touch" mc:Ignorable="d" - Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" MinWidth="560" MinHeight="555" d:DataContext="{d:DesignInstance Type=local:BasicColorCorrectionViewVM, IsDesignTimeCreatable=False}"> + Background="{StaticResource TangoPrimaryBackgroundBrush}" d:DesignHeight="555" d:DesignWidth="560" MinWidth="560" Height="555" d:DataContext="{d:DesignInstance Type=local:BasicColorCorrectionViewVM, IsDesignTimeCreatable=False}"> <Grid> - <TextBlock FontSize="{StaticResource TangoHeaderFontSize}">This is a dialog</TextBlock> + <Grid Margin="20"> + <Grid.RowDefinitions> + <RowDefinition Height="40"/> + <RowDefinition Height="100"/> + <RowDefinition Height="1*"/> + <RowDefinition Height="101"/> + </Grid.RowDefinitions> - <touch:TouchButton VerticalAlignment="Bottom" HorizontalAlignment="Right" Width="200" Height="50" Command="{Binding OKCommand}"> - OK - </touch:TouchButton> + <TextBlock VerticalAlignment="Center" FontSize="{StaticResource TangoTitleFontSize}" Foreground="{StaticResource TangoErrorBrush}">Color is out of gamut</TextBlock> + + <StackPanel Orientation="Horizontal" Grid.Row="1" VerticalAlignment="Center"> + <Image Source="../Images/JobView/error.png" Stretch="None" /> + <Ellipse Width="60" Height="60" Margin="20 0 0 0" Fill="{Binding InvalidBrushStop.Brush}" /> + <TextBlock VerticalAlignment="Center" Foreground="{StaticResource TangoGrayTextBrush}" Margin="20 0 0 0"> + <Run Text="{Binding InvalidBrushStop.Red}"></Run><Run>,</Run> + <Run Text="{Binding InvalidBrushStop.Green}"></Run><Run>,</Run> + <Run Text="{Binding InvalidBrushStop.Blue}"></Run> + </TextBlock> + </StackPanel> + + <DockPanel Grid.Row="2" Margin="0 0 0 0"> + <TextBlock DockPanel.Dock="Top" Margin="40 0 0 0">Please select an alternative</TextBlock> + + <!--<Grid>--> + <touch:TouchListBox SelectionMode="Single" Style="{StaticResource TangoBasicListBox}" ItemsSource="{Binding Results}" Margin="0 20 0 0"> + <touch:TouchListBox.ItemContainerStyle> + <Style TargetType="touch:TouchListBoxItem"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="Margin" Value="0 10"></Setter> + </Style> + </touch:TouchListBox.ItemContainerStyle> + <touch:TouchListBox.ItemTemplate> + <DataTemplate DataType="{x:Type models:ColorConversionResult}"> + <StackPanel Orientation="Horizontal"> + <Ellipse Width="60" Height="60" Margin="40 0 0 0" Fill="{Binding Brush}" RenderTransformOrigin="0.5,0.5"> + <Ellipse.Style> + <Style TargetType="Ellipse"> + <Setter Property="RenderTransform"> + <Setter.Value> + <ScaleTransform ScaleX="1" ScaleY="1" /> + </Setter.Value> + </Setter> + <Setter Property="Effect"> + <Setter.Value> + <DropShadowEffect Color="{StaticResource TangoDropShadowColor}" ShadowDepth="0" BlurRadius="10" Opacity="0" /> + </Setter.Value> + </Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=touch:TouchListBoxItem},Path=IsSelected}" Value="True"> + <DataTrigger.EnterActions> + <BeginStoryboard> + <Storyboard> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" To="1.2" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1.2" Duration="00:00:0.2" /> + <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:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" To="1" Duration="00:00:0.2" /> + <DoubleAnimation Storyboard.TargetProperty="Effect.Opacity" To="0" Duration="00:00:0.2" /> + </Storyboard> + </BeginStoryboard> + </DataTrigger.ExitActions> + </DataTrigger> + </Style.Triggers> + </Style> + </Ellipse.Style> + </Ellipse> + <TextBlock VerticalAlignment="Center" Margin="20 0 0 0"> + <Run Text="{Binding Color.R}"></Run><Run>,</Run> + <Run Text="{Binding Color.G}"></Run><Run>,</Run> + <Run Text="{Binding Color.B}"></Run> + </TextBlock> + </StackPanel> + </DataTemplate> + </touch:TouchListBox.ItemTemplate> + </touch:TouchListBox> + <!--</Grid>--> + </DockPanel> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs index a146d2348..9ad80e025 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Dialogs/BasicColorCorrectionViewVM.cs @@ -3,12 +3,52 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using Tango.BL.Entities; +using Tango.PPC.Jobs.Models; using Tango.SharedUI; namespace Tango.PPC.Jobs.Dialogs { public class BasicColorCorrectionViewVM : DialogViewVM { + public BrushStop InvalidBrushStop { get; set; } + public List<ColorConversionResult> Results { get; set; } + + public BasicColorCorrectionViewVM() + { + Results = new List<ColorConversionResult>(); + + Results.Add(new ColorConversionResult() + { + Coordinates = new PMR.ColorLab.OutputCoordinates() + { + Red = 255, + Green = 0, + Blue = 0 + }, + }); + + Results.Add(new ColorConversionResult() + { + Coordinates = new PMR.ColorLab.OutputCoordinates() + { + Red = 0, + Green = 255, + Blue = 0 + }, + }); + + Results.Add(new ColorConversionResult() + { + Coordinates = new PMR.ColorLab.OutputCoordinates() + { + Red = 0, + Green = 0, + Blue = 255 + }, + }); + + } } } diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs new file mode 100644 index 000000000..32d4733f7 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Models/ColorConversionResult.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Media; +using Tango.Core; +using Tango.PMR.ColorLab; + +namespace Tango.PPC.Jobs.Models +{ + public class ColorConversionResult : ExtendedObject + { + public Color Color + { + get + { + return Color.FromRgb((byte)Coordinates.Red, (byte)Coordinates.Green, (byte)Coordinates.Blue); + } + } + + public SolidColorBrush Brush + { + get { return new SolidColorBrush(Color); } + } + + private OutputCoordinates _coordinates; + public OutputCoordinates Coordinates + { + get { return _coordinates; } + set { _coordinates = value; RaisePropertyChangedAuto(); RaisePropertyChanged(nameof(Color)); RaisePropertyChanged(nameof(Brush)); } + } + } +} diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj index 82f890876..940c438d2 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Tango.PPC.Jobs.csproj @@ -114,6 +114,7 @@ <Compile Include="Messages\JobRemovedMessage.cs" /> <Compile Include="Messages\JobSavedMessage.cs" /> <Compile Include="Messages\JobSelectedMessage.cs" /> + <Compile Include="Models\ColorConversionResult.cs" /> <Compile Include="Properties\AssemblyInfo.cs"> <SubType>Code</SubType> </Compile> diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs index b7f4eea9a..85aab2129 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/ViewModels/JobViewVM.cs @@ -313,7 +313,10 @@ namespace Tango.PPC.Jobs.ViewModels /// <param name="brushStop">The brush stop.</param> private async void InvokeColorAdjustmentForBrushStop(BrushStop brushStop) { - var vm = await NotificationProvider.ShowDialog<BasicColorCorrectionViewVM>(); + var vm = await NotificationProvider.ShowDialog<BasicColorCorrectionViewVM>(new BasicColorCorrectionViewVM() + { + InvalidBrushStop = brushStop, + }); var b = vm; } 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 c8041863b..e28234573 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -13,6 +13,7 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchToggleButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchIconButton.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchListBox.xaml" /> <!--PPC--> <ResourceDictionary Source="pack://application:,,,/Tango.PPC.Common;component/Resources/Colors.xaml"/> diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs index 134cd6d0b..571067c7f 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs @@ -12,6 +12,10 @@ using System.Windows.Media; using Tango.Core; using Tango.BL; using Tango.BL.Enumerations; +using Tango.PMR.ColorLab; +using Google.Protobuf; +using System.Runtime.InteropServices; +using Tango.PMR; namespace Tango.BL.Entities { @@ -21,6 +25,9 @@ namespace Tango.BL.Entities /// <seealso cref="Tango.BL.Entities.ObservableEntity{Tango.BL.Entities.BrushStop}" /> public partial class BrushStop { + [DllImport("Tango.ColorLib.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "Convert")] + public static extern int Convert(IntPtr data, int size, ref IntPtr output); + [NotMapped] private bool _ignorePropChanged; @@ -68,7 +75,7 @@ namespace Tango.BL.Entities _b = lab.B; break; case ColorSpaces.RGB: - default: + default: _red = (byte)rgb.R; _green = (byte)rgb.G; _blue = (byte)rgb.B; @@ -81,6 +88,16 @@ namespace Tango.BL.Entities } /// <summary> + /// Gets the stop color brush. + /// </summary> + [NotMapped] + [JsonIgnore] + public SolidColorBrush Brush + { + get { return new SolidColorBrush(Color); } + } + + /// <summary> /// Gets a value indicating whether this brush stop is the first one within its segment brush stops. /// </summary> [NotMapped] @@ -177,6 +194,17 @@ namespace Tango.BL.Entities } } + private bool _performColorConversion; + /// <summary> + /// Gets or sets a value indicating whether to perform color conversion. + /// </summary> + [NotMapped] + public bool PerformColorConversion + { + get { return _performColorConversion; } + set { _performColorConversion = value; RaisePropertyChangedAuto(); } + } + #endregion #region Public Methods @@ -209,6 +237,16 @@ namespace Tango.BL.Entities } } + public double GetVolume(int packIndex) + { + return (double)typeof(BrushStop).GetProperty("V" + packIndex).GetValue(this); + } + + public void SetVolume(int packIndex, double volume) + { + typeof(BrushStop).GetProperty("V" + packIndex).SetValue(this, volume); + } + public void SetStopIndex(int index) { _stopindex = index; @@ -310,6 +348,68 @@ namespace Tango.BL.Entities //TODO: Remove this.. IsOutOfGamut = _red > 250; + + + + //if (Segment != null && Segment.Job != null && Segment.Job.Rml != null) + //{ + // var rml = Segment.Job.Rml; + + // ConversionInput conversionInput = new ConversionInput(); + + // conversionInput.ColorSpace = (PMR.ColorLab.ColorSpace)ColorSpace.Code; + // conversionInput.InputCoordinates = new InputCoordinates(); + + // conversionInput.SegmentLength = Segment.Length; + + // conversionInput.InputCoordinates.Red = _red; + // conversionInput.InputCoordinates.Green = _green; + // conversionInput.InputCoordinates.Blue = _blue; + + // conversionInput.InputCoordinates.L = _l; + // conversionInput.InputCoordinates.A = _a; + // conversionInput.InputCoordinates.B = _b; + + // conversionInput.InputCoordinates.Cyan = _cyan; + // conversionInput.InputCoordinates.Magenta = _magenta; + // conversionInput.InputCoordinates.Yellow = _yellow; + // conversionInput.InputCoordinates.Key = _black; + + // conversionInput.ThreadL = rml.MediaColor.L; + // conversionInput.ThreadA = rml.MediaColor.A; + // conversionInput.ThreadB = rml.MediaColor.B; + + // var cct = rml.Ccts.LastOrDefault(); + + // conversionInput.ForwardData = ByteString.CopyFrom(cct.ForwardData); + // conversionInput.InverseData = ByteString.CopyFrom(cct.InverseData); + + // var configuration = Segment.Job.Machine.Configuration; + + // List<LiquidTypesRml> factors = configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex).Select(x => x.LiquidType).SelectMany(x => x.LiquidTypesRmls).Where(x => x.Rml.Guid == rml.Guid).ToList(); + + // foreach (var idsPack in configuration.NoneEmptyIdsPacks.OrderBy(x => x.PackIndex)) + // { + // InputLiquid inputLiquid = new InputLiquid(); + // inputLiquid.LiquidType = idsPack.LiquidType.ToColorLibLiquidType(); + + // inputLiquid.MaxNanoliterPerCentimeter = factors[idsPack.PackIndex].MaxNlPerCm; + // inputLiquid.CalibrationData = idsPack.LiquidType.Cats.SingleOrDefault(x => x.Machine == Segment.Job.Machine && x.Rml == rml).GetCalibrationData(); + // inputLiquid.Volume = GetVolume(idsPack.PackIndex); + + // conversionInput.InputCoordinates.InputLiquids.Add(inputLiquid); + // } + + // NativePMR<ConversionInput, ConversionOutput> nativePMR = new NativePMR<ConversionInput, ConversionOutput>(Convert); + // ConversionOutput output = nativePMR.Invoke(conversionInput); + + // SetLiquidVolumes( + // Segment.Job.Machine.Configuration, + // Segment.Job.Rml, + // Segment.Job.Rml.ProcessParametersTablesGroups.Last().ProcessParametersTables.Single(x => x.TableIndex == output.SingleCoordinates.ProcessParametersTableIndex)); + + // IsOutOfGamut = output.OutOfGamut; + //} } #endregion diff --git a/Software/Visual_Studio/Tango.BL/LiquidVolume.cs b/Software/Visual_Studio/Tango.BL/LiquidVolume.cs index 7049b5fd0..a8366e8a0 100644 --- a/Software/Visual_Studio/Tango.BL/LiquidVolume.cs +++ b/Software/Visual_Studio/Tango.BL/LiquidVolume.cs @@ -86,7 +86,7 @@ namespace Tango.BL { _volume = DispensingCalcService.CoerceVolume(this); - typeof(BrushStop).GetProperty("V" + IdsPack.PackIndex).SetValue(BrushStop, Volume); + BrushStop.SetVolume(IdsPack.PackIndex, Volume); RaisePropertyChanged(nameof(LiquidMaxNanoliterPerCentimeter)); RaisePropertyChanged(nameof(NanoliterPerSecond)); RaisePropertyChanged(nameof(PulsePerSecond)); @@ -106,8 +106,7 @@ namespace Tango.BL IdsPack = idsPack; Configuration = configuration; RML = rml; - - Volume = (double)typeof(BrushStop).GetProperty("V" + IdsPack.PackIndex).GetValue(BrushStop); + Volume = BrushStop.GetVolume(idsPack.PackIndex); } private void OnVolumeChanged() diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index dc78dc8a3..ebc72b437 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -34,6 +34,7 @@ <Reference Include="Google.Protobuf, Version=3.4.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL"> <HintPath>..\packages\Google.Protobuf.3.4.1\lib\net45\Google.Protobuf.dll</HintPath> </Reference> + <Reference Include="PresentationCore" /> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Xml.Linq" /> diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml index 7d757740a..e62404309 100644 --- a/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchButton.xaml @@ -26,4 +26,13 @@ <Setter Property="RippleFactor" Value="10"></Setter> </Style> + <Style x:Key="TangoHollowButton" TargetType="{x:Type controls:TouchButton}"> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="CornerRadius" Value="20"></Setter> + <Setter Property="TextElement.Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> + <Setter Property="BorderThickness" Value="1"></Setter> + <Setter Property="BorderBrush" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter> + <Setter Property="RippleBrush" Value="{StaticResource TangoRippleDarkBrush}"></Setter> + </Style> + </ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml b/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml new file mode 100644 index 000000000..dece0f8ba --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Styles/TouchListBox.xaml @@ -0,0 +1,48 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI" + xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" + xmlns:localConverters="clr-namespace:Tango.Touch.Converters" + xmlns:local="clr-namespace:Tango.Touch.Controls"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Resources/Colors.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <localConverters:SelectionModesToBooleanConverter x:Key="SelectionModesToBooleanConverter" /> + + <Style x:Key="TangoBasicListBox" TargetType="{x:Type local:TouchListBox}"> + <Setter Property="IsManipulationEnabled" Value="True"></Setter> + <Setter Property="local:TouchPanel.PreventFocusSteal" Value="True"></Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type local:TouchListBox}"> + <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"> + <local:LightTouchScrollViewer x:Name="PART_ScrollViewer"> + <ItemsControl VirtualizingPanel.IsVirtualizing="False" x:Name="PART_ItemsControl" Style="{x:Null}" ItemsSource="{TemplateBinding ItemsSource}" VerticalAlignment="Top" ClipToBounds="True"> + <ItemsControl.ItemsPanel> + <ItemsPanelTemplate> + <StackPanel VirtualizingPanel.IsVirtualizing="False" Orientation="Vertical" VerticalAlignment="Top" /> + </ItemsPanelTemplate> + </ItemsControl.ItemsPanel> + <ItemsControl.ItemTemplate> + <DataTemplate> + <local:TouchListBoxItem Style="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=ItemContainerStyle}"> + <i:Interaction.Triggers> + <i:EventTrigger EventName="Loaded"> + <i:InvokeCommandAction Command="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=ListBoxItemLoadedCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBoxItem}}" /> + </i:EventTrigger> + </i:Interaction.Triggers> + <ContentControl Content="{Binding}" ContentTemplate="{Binding RelativeSource={RelativeSource AncestorType=local:TouchListBox},Path=ItemTemplate}" /> + </local:TouchListBoxItem> + </DataTemplate> + </ItemsControl.ItemTemplate> + </ItemsControl> + </local:LightTouchScrollViewer> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj index d0dbcfff1..ae48a2664 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -214,6 +214,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Styles\TouchListBox.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Styles\TouchToggleButton.xaml"> <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml index a8fc351c1..64e7555ab 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -38,6 +38,7 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchToggleButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchIconButton.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchListBox.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchPanel.xaml" /> </ResourceDictionary.MergedDictionaries> |
