diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-06-29 02:04:39 +0300 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2018-06-29 02:04:39 +0300 |
| commit | da35b8b425a6cf269b836e34b7223742dd37a557 (patch) | |
| tree | e1eb158446bea28e33d7946e364b1be1cd071a59 | |
| parent | 6e0dac45f0d4078b2898836309e3faba3edb4bc7 (diff) | |
| download | Tango-da35b8b425a6cf269b836e34b7223742dd37a557.tar.gz Tango-da35b8b425a6cf269b836e34b7223742dd37a557.zip | |
Implemented BrushStop out of gamut property.
Implemented Segment HasOutOfGamutBrushStop property.
Implemented JobView Out Of Gamut errors and notifications..
21 files changed, 204 insertions, 35 deletions
diff --git a/Software/Graphics/Mobile/error.png b/Software/Graphics/Mobile/error.png Binary files differnew file mode 100644 index 000000000..02a0a91a9 --- /dev/null +++ b/Software/Graphics/Mobile/error.png diff --git a/Software/Graphics/Mobile/error@2x.png b/Software/Graphics/Mobile/error@2x.png Binary files differnew file mode 100644 index 000000000..9ef36018d --- /dev/null +++ b/Software/Graphics/Mobile/error@2x.png diff --git a/Software/Graphics/Mobile/error@3x.png b/Software/Graphics/Mobile/error@3x.png Binary files differnew file mode 100644 index 000000000..da9d34557 --- /dev/null +++ b/Software/Graphics/Mobile/error@3x.png diff --git a/Software/Graphics/Mobile/replace-color.png b/Software/Graphics/Mobile/replace-color.png Binary files differnew file mode 100644 index 000000000..af5655416 --- /dev/null +++ b/Software/Graphics/Mobile/replace-color.png diff --git a/Software/Graphics/Mobile/replace-color@2x.png b/Software/Graphics/Mobile/replace-color@2x.png Binary files differnew file mode 100644 index 000000000..ca6923438 --- /dev/null +++ b/Software/Graphics/Mobile/replace-color@2x.png diff --git a/Software/Graphics/Mobile/replace-color@3x.png b/Software/Graphics/Mobile/replace-color@3x.png Binary files differnew file mode 100644 index 000000000..7a45c88d8 --- /dev/null +++ b/Software/Graphics/Mobile/replace-color@3x.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/error.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/error.png Binary files differnew file mode 100644 index 000000000..02a0a91a9 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/error.png diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/replace-color.png b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/replace-color.png Binary files differnew file mode 100644 index 000000000..af5655416 --- /dev/null +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Images/JobView/replace-color.png 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 c31bca117..7a4eed850 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 @@ -231,6 +231,11 @@ <ItemGroup> <Resource Include="Images\JobView\settings.png" /> </ItemGroup> - <ItemGroup /> + <ItemGroup> + <Resource Include="Images\JobView\error.png" /> + </ItemGroup> + <ItemGroup> + <Resource Include="Images\JobView\replace-color.png" /> + </ItemGroup> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> </Project>
\ No newline at end of file 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 ca6a7ccea..c08b4cd25 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 @@ -152,6 +152,11 @@ namespace Tango.PPC.Jobs.ViewModels /// </summary> public RelayCommand SaveJobCommand { get; set; } + /// <summary> + /// Gets or sets the replace brush stop command. + /// </summary> + public RelayCommand<BrushStop> ReplaceBrushStopCommand { get; set; } + #endregion #region Constructors @@ -183,6 +188,7 @@ namespace Tango.PPC.Jobs.ViewModels RemoveBrushStopCommand = new RelayCommand<BrushStop>(RemoveBrushStop); RemoveJobCommand = new RelayCommand(RemoveJob); SaveJobCommand = new RelayCommand(SaveJob); + ReplaceBrushStopCommand = new RelayCommand<BrushStop>(InvokeColorAdjustmentForBrushStop); } #endregion @@ -300,6 +306,15 @@ namespace Tango.PPC.Jobs.ViewModels } } + /// <summary> + /// Invokes the color adjustment for the specified brush stop. + /// </summary> + /// <param name="brushStop">The brush stop.</param> + private void InvokeColorAdjustmentForBrushStop(BrushStop brushStop) + { + NotificationProvider.ShowInfo(brushStop.StopIndex.ToString()); + } + #endregion #region Job Selection Message diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml index a3c1b8800..169666009 100644 --- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml +++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Jobs/Views/JobView.xaml @@ -208,10 +208,15 @@ <Grid> <DockPanel Margin="30 0" VerticalAlignment="Center"> - <TextBlock DockPanel.Dock="Top" FontSize="{StaticResource TangoTitleFontSize}"> + <StackPanel DockPanel.Dock="Top" Orientation="Horizontal"> + <Canvas Visibility="{Binding HasOutOfGamutBrushStop,Converter={StaticResource BooleanToVisibilityConverter}}"> + <Image Canvas.Left="-25" Canvas.Top="1" Source="../Images/JobView/error.png" Width="19" Height="19" /> + </Canvas> + <TextBlock FontSize="{StaticResource TangoTitleFontSize}"> <Run>Segment #</Run> <Run Text="{Binding SegmentIndex,Mode=OneWay}"></Run> - </TextBlock> + </TextBlock> + </StackPanel> <StackPanel Margin="0 30 0 0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Width="300" Visibility="{Binding ElementName=toggle_large_list,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}"> <DockPanel LastChildFill="False"> @@ -228,26 +233,45 @@ <TextBlock VerticalAlignment="Center" DockPanel.Dock="Left" Text="Color code:"></TextBlock> <Grid DockPanel.Dock="Right" DataContext="{Binding BrushStops[0]}"> - <ContentControl Focusable="False" FocusVisualStyle="{x:Null}" d:DataContext="{d:DesignInstance Type=entities:BrushStop, IsDesignTimeCreatable=False}" Content="{Binding}" Width="180"> - <ContentControl.Style> - <Style TargetType="ContentControl"> - <Setter Property="ContentTemplate" Value="{x:Null}"></Setter> - <Style.Triggers> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="RGB"> - <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> - </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="CMYK"> - <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> - </DataTrigger> - <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="LAB"> - <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> - </DataTrigger> - </Style.Triggers> - </Style> - </ContentControl.Style> - </ContentControl> + <StackPanel> + <ContentControl Focusable="False" FocusVisualStyle="{x:Null}" d:DataContext="{d:DesignInstance Type=entities:BrushStop, IsDesignTimeCreatable=False}" Content="{Binding}" Width="180"> + <ContentControl.Style> + <Style TargetType="ContentControl"> + <Setter Property="ContentTemplate" Value="{x:Null}"></Setter> + <Style.Triggers> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="RGB"> + <Setter Property="ContentTemplate" Value="{StaticResource RGB_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="CMYK"> + <Setter Property="ContentTemplate" Value="{StaticResource CMYK_Template}" /> + </DataTrigger> + <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.Job.ColorSpace.Name}" Value="LAB"> + <Setter Property="ContentTemplate" Value="{StaticResource LAB_Template}" /> + </DataTrigger> + </Style.Triggers> + </Style> + </ContentControl.Style> + </ContentControl> + </StackPanel> </Grid> </DockPanel> + <Canvas> + <Canvas.Style> + <Style TargetType="Canvas"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="False" /> + <Condition Binding="{Binding BrushStops[0].IsOutOfGamut}" Value="True" /> + </MultiDataTrigger.Conditions> + <Setter Property="Visibility" Value="Visible"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </Canvas.Style> + <TextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></TextBlock> + </Canvas> <DockPanel LastChildFill="False" Margin="0 20 0 0"> <TextBlock VerticalAlignment="Center" DockPanel.Dock="Left" Text="Length (m):"></TextBlock> <touch:TouchNumericTextBox Width="180" DockPanel.Dock="Right" Value="{Binding Length}" StringFormat="0.0" AutoCalculateJogStep="False" HasDecimalPoint="True" Maximum="100000" KeyboardContainer="{Binding ElementName=Container}" /> @@ -268,7 +292,27 @@ </Style> </TextBlock.Style> </TextBlock> + + <touch:TouchImageButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding BrushStops[0]}" Width="50" Height="50" Padding="10" Image="../Images/JobView/replace-color.png" CornerRadius="30"> + <touch:TouchImageButton.Style> + <Style TargetType="{x:Type touch:TouchImageButton}" BasedOn="{StaticResource {x:Type touch:TouchImageButton}}"> + <Setter Property="Visibility" Value="Collapsed"></Setter> + <Style.Triggers> + <MultiDataTrigger> + <MultiDataTrigger.Conditions> + <Condition Binding="{Binding ElementName=toggle_large_list,Path=IsChecked}" Value="True" /> + <Condition Binding="{Binding Converter={StaticResource IsSegmentGradientConverter}}" Value="False" /> + <Condition Binding="{Binding BrushStops[0].IsOutOfGamut}" Value="True" /> + </MultiDataTrigger.Conditions> + <Setter Property="Visibility" Value="Visible"></Setter> + </MultiDataTrigger> + </Style.Triggers> + </Style> + </touch:TouchImageButton.Style> + </touch:TouchImageButton> + <StackPanel Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Orientation="Horizontal"> + <touch:TouchIconButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveSegmentCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashOutline" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> <dragAndDrop:DragThumb Background="Transparent" IsHitTestVisible="True"> @@ -337,6 +381,10 @@ </ContentControl> </DockPanel> + <Canvas Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}"> + <TextBlock Canvas.Top="2" Foreground="{StaticResource TangoErrorBrush}" FontSize="{StaticResource TangoSmallFontSize}" Text="Color is out of gamut. Modify color or select an alternative."></TextBlock> + </Canvas> + <DockPanel LastChildFill="False" Margin="0 20 0 0" IsEnabled="{Binding IsMiddle}"> <TextBlock VerticalAlignment="Bottom" DockPanel.Dock="Left">Position (m):</TextBlock> <Grid Margin="20 0 0 0" Width="300" DockPanel.Dock="Right"> @@ -350,7 +398,11 @@ </Grid> </DockPanel> </StackPanel> - <touch:TouchIconButton Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Margin="0 0 -80 0" HorizontalAlignment="Right" VerticalAlignment="Top" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveBrushStopCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashOutline" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> + + <StackPanel Orientation="Horizontal" Margin="0 0 -130 0" HorizontalAlignment="Right" VerticalAlignment="Top"> + <touch:TouchImageButton Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ReplaceBrushStopCommand}" CommandParameter="{Binding}" Visibility="{Binding IsOutOfGamut,Converter={StaticResource BooleanToVisibilityConverter}}" Width="50" Height="50" Padding="10" Image="../Images/JobView/replace-color.png" CornerRadius="30"></touch:TouchImageButton> + <touch:TouchIconButton Margin="0 0 50 0" Visibility="{Binding ElementName=toggleEdit,Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.RemoveBrushStopCommand}" CommandParameter="{Binding}" EnableDropShadow="False" Icon="TrashOutline" Padding="12" Foreground="{StaticResource TangoPrimaryAccentBrush}" Width="50" Height="50" RippleBrush="{StaticResource TangoRippleDarkBrush}" CornerRadius="30" /> + </StackPanel> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> @@ -481,13 +533,13 @@ <Grid Grid.Row="1"> <Grid IsHitTestVisible="False"> - <Grid.Background> - <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> - <GradientStop Offset="0" Color="#AEFFFFFF" /> - <GradientStop Offset="1" Color="{StaticResource TangoPrimaryBackgroundColor}" /> - </LinearGradientBrush> - </Grid.Background> - <Rectangle Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" /> + <Grid.Background> + <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1"> + <GradientStop Offset="0" Color="#AEFFFFFF" /> + <GradientStop Offset="1" Color="{StaticResource TangoPrimaryBackgroundColor}" /> + </LinearGradientBrush> + </Grid.Background> + <Rectangle Stroke="{StaticResource TangoDividerBrush}" StrokeThickness="1" VerticalAlignment="Top" /> </Grid> <Border Padding="20 20"> <Grid> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs index f823e88aa..f1ee1ac87 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.UI/PPCApplication/DefaultPPCApplicationManager.cs @@ -127,6 +127,7 @@ namespace Tango.PPC.UI.PPCApplication } var settings = SettingsManager.Default.GetOrCreate<PPCSettings>(); + var coreSettings = SettingsManager.Default.GetOrCreate<CoreSettings>(); if (!SettingsManager.Default.IsFileExists()) { diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs index bdb308f45..134cd6d0b 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/BrushStop.cs @@ -158,6 +158,25 @@ namespace Tango.BL.Entities } } + private bool _isOutOfGamut; + /// <summary> + /// Gets or sets a value indicating whether this instance is out of gamut. + /// </summary> + [NotMapped] + public bool IsOutOfGamut + { + get { return _isOutOfGamut; } + set + { + _isOutOfGamut = value; RaisePropertyChangedAuto(); + + if (Segment != null) + { + Segment.RaiseHasOutOfGamutBrushStop(); + } + } + } + #endregion #region Public Methods @@ -288,6 +307,9 @@ namespace Tango.BL.Entities _l = lab.L; _a = lab.A; _b = lab.B; + + //TODO: Remove this.. + IsOutOfGamut = _red > 250; } #endregion diff --git a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Segment.cs b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Segment.cs index 61fd35558..82596129e 100644 --- a/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Segment.cs +++ b/Software/Visual_Studio/Tango.BL/EntitiesExtensions/Segment.cs @@ -119,6 +119,17 @@ namespace Tango.BL.Entities } } + [NotMapped] + public bool HasOutOfGamutBrushStop + { + get { return BrushStops.Any(x => x.IsOutOfGamut); } + } + + internal void RaiseHasOutOfGamutBrushStop() + { + RaisePropertyChanged(nameof(HasOutOfGamutBrushStop)); + } + public override Segment Clone() { Segment cloned = base.Clone(); diff --git a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs index 8c0957e9a..1473845c5 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesContextExtension.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Data.Entity; using System.Data.SQLite; using System.IO; using System.Linq; @@ -19,7 +20,7 @@ namespace Tango.BL /// <param name="isFile">if set to <c>true</c> will try to connect to an .mdf file.</param> public ObservablesContext(String path) : base(ComposeConnectionString(path)) { - + Database.SetInitializer<ObservablesContext>(null); } /// <summary> @@ -28,7 +29,7 @@ namespace Tango.BL /// <param name="sqliteConnection">The SQLite connection.</param> public ObservablesContext(SQLiteConnection sqliteConnection) : base(sqliteConnection, true) { - + Database.SetInitializer<ObservablesContext>(null); } /// <summary> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchIconButton.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchIconButton.xaml index e69c3eb6d..3adc39a73 100644 --- a/Software/Visual_Studio/Tango.Touch/Controls/TouchIconButton.xaml +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchIconButton.xaml @@ -11,6 +11,7 @@ <Setter Property="Icon" Value="None"></Setter> <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter> <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="EnableDropShadow" Value="False"></Setter> <Setter Property="ContentTemplate"> <Setter.Value> <DataTemplate> diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchImageButton.cs b/Software/Visual_Studio/Tango.Touch/Controls/TouchImageButton.cs new file mode 100644 index 000000000..08ba0eb26 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchImageButton.cs @@ -0,0 +1,33 @@ +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; + +namespace Tango.Touch.Controls +{ + public class TouchImageButton : TouchButton + { + public BitmapSource Image + { + get { return (BitmapSource)GetValue(ImageProperty); } + set { SetValue(ImageProperty, value); } + } + public static readonly DependencyProperty ImageProperty = + DependencyProperty.Register("Image", typeof(BitmapSource), typeof(TouchImageButton), new PropertyMetadata(null)); + + static TouchImageButton() + { + DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchImageButton), new FrameworkPropertyMetadata(typeof(TouchImageButton))); + } + } +} diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchImageButton.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchImageButton.xaml new file mode 100644 index 000000000..a05c42e86 --- /dev/null +++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchImageButton.xaml @@ -0,0 +1,23 @@ +<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:local="clr-namespace:Tango.Touch.Controls"> + + <ResourceDictionary.MergedDictionaries> + <ResourceDictionary Source="../Controls/TouchButton.xaml" /> + </ResourceDictionary.MergedDictionaries> + + <Style TargetType="{x:Type local:TouchImageButton}" BasedOn="{StaticResource {x:Type local:TouchButton}}"> + <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter> + <Setter Property="Background" Value="Transparent"></Setter> + <Setter Property="RippleBrush" Value="{StaticResource TangoRippleDarkBrush}"></Setter> + <Setter Property="EnableDropShadow" Value="False"></Setter> + <Setter Property="ContentTemplate"> + <Setter.Value> + <DataTemplate> + <Image Source="{Binding RelativeSource={RelativeSource AncestorType=local:TouchImageButton},Path=Image}"></Image> + </DataTemplate> + </Setter.Value> + </Setter> + </Style> + +</ResourceDictionary>
\ No newline at end of file diff --git a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml index c2be8d940..782fefdea 100644 --- a/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml +++ b/Software/Visual_Studio/Tango.Touch/Resources/Colors.xaml @@ -42,6 +42,7 @@ <Color x:Key="TangoGrayColor">#c1c5cb</Color> <Color x:Key="TangoRedColor">#FF6767</Color> + <Color x:Key="TangoErrorColor">#fa1555</Color> <!--Brushes--> <SolidColorBrush x:Key="TangoPrimaryBackgroundBrush" Color="{StaticResource TangoPrimaryBackgroundColor}"></SolidColorBrush> @@ -82,4 +83,6 @@ <SolidColorBrush x:Key="TangoGreenBrush" Color="{StaticResource TangoGreenColor}"></SolidColorBrush> <SolidColorBrush x:Key="TangoGrayBrush" Color="{StaticResource TangoGrayColor}"></SolidColorBrush> <SolidColorBrush x:Key="TangoRedBrush" Color="{StaticResource TangoRedColor}"></SolidColorBrush> + + <SolidColorBrush x:Key="TangoErrorBrush" Color="{StaticResource TangoErrorColor}"></SolidColorBrush> </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 cf0964032..d0dbcfff1 100644 --- a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj +++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj @@ -67,6 +67,7 @@ <Compile Include="Controls\TouchCheckBox.cs" /> <Compile Include="Controls\TouchComboBox.cs" /> <Compile Include="Controls\TouchExpander.cs" /> + <Compile Include="Controls\TouchImageButton.cs" /> <Compile Include="Controls\TouchInput.cs" /> <Compile Include="Controls\TouchListBox.cs" /> <Compile Include="Controls\TouchListBoxItem.cs" /> @@ -109,6 +110,10 @@ <SubType>Designer</SubType> <Generator>MSBuild:Compile</Generator> </Page> + <Page Include="Controls\TouchImageButton.xaml"> + <SubType>Designer</SubType> + <Generator>MSBuild:Compile</Generator> + </Page> <Page Include="Controls\TouchListBox.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 e8c448220..a8fc351c1 100644 --- a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml +++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml @@ -12,6 +12,7 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchScrollViewer.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/Shared.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchButton.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchImageButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchToggleButton.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchDataGrid.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchNavigationLinks.xaml" /> @@ -40,10 +41,6 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchPanel.xaml" /> </ResourceDictionary.MergedDictionaries> - - - - </ResourceDictionary> |
