diff options
| author | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-02-08 12:48:14 +0200 |
|---|---|---|
| committer | Victoria Plitt <Victoria.Plitt@twine-s.com> | 2022-02-08 12:48:14 +0200 |
| commit | 199aa2eb46bf1625d0bbc8b98efe35d158cff9be (patch) | |
| tree | 28393fc49d347530a4e36777ec0bec9ea47b7bdd /Software/Visual_Studio/PPC/Tango.PPC.Common | |
| parent | b10afe316e91d0600cd1f668f86767883cce4bb9 (diff) | |
| download | Tango-199aa2eb46bf1625d0bbc8b98efe35d158cff9be.tar.gz Tango-199aa2eb46bf1625d0bbc8b98efe35d158cff9be.zip | |
Implement MyColors in PPC
Related Work Items: #4558
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common')
3 files changed, 30 insertions, 7 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs index 9b865c18b..3af921f7d 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Controls/TwineCatalogRenderer.cs @@ -52,7 +52,7 @@ namespace Tango.PPC.Common.Controls private double groupMargin = 50; private bool selectedFromClick; private LightTouchScrollViewer _scrollViewer; - private BitmapSource _myColorBitmap; + // private BitmapSource _myColorBitmap; private double imageWidth = 24; private double imageHeight = 22; private Point _lastMouseClickPoint; @@ -100,7 +100,7 @@ namespace Tango.PPC.Common.Controls this.PreviewMouseUp += TwineCatalogRenderer_MouseLeftButtonUp; this.Loaded += TwineCatalogRenderer_Loaded; - _myColorBitmap = new BitmapImage(new Uri($"pack://application:,,,/Tango.PPC.JobsV2;component/Images/ColorSelection/Heart.png", UriKind.Absolute)); + // _myColorBitmap = new BitmapImage(new Uri($"pack://application:,,,/Tango.PPC.JobsV2;component/Images/ColorSelection/Heart.png", UriKind.Absolute)); } private void TwineCatalogRenderer_Loaded(object sender, RoutedEventArgs e) @@ -292,7 +292,7 @@ namespace Tango.PPC.Common.Controls DrawingVisual drawingVisual = new DrawingVisual(); DrawingContext drawingContext = drawingVisual.RenderOpen(); - drawingContext.DrawImage(_myColorBitmap, imageRect); + // drawingContext.DrawImage(_myColorBitmap, imageRect); drawingContext.DrawEllipse(new SolidColorBrush(item.Color), null, new Point(x + ellipseWidth / 2, y + ellipseHeight / 2), ellipseWidth / 2, ellipseHeight / 2); 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 bb0a694cf..780941f66 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Merged.xaml @@ -19,6 +19,7 @@ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchCheckBox.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchExpander.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchNumericUpDownControl.xaml" /> + <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Styles/TouchScrollViewer.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchExpander.xaml" /> <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Controls/TouchNativeListBox.xaml" /> diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Styles.xaml b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Styles.xaml index bb1890e7f..432f2b58b 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Styles.xaml +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Resources/Styles.xaml @@ -58,10 +58,32 @@ <Setter.Value> <ControlTemplate TargetType="{x:Type ListBox}"> <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"> - <touch:TouchScrollViewer CanContentScroll="True" - Padding="{TemplateBinding Padding}" - Focusable="False" - HorizontalScrollBarVisibility="Hidden"> + <touch:TouchScrollViewer CanContentScroll="True" Padding="{TemplateBinding Padding}" Focusable="False" HorizontalScrollBarVisibility="Hidden"> + <ItemsPresenter /> + </touch:TouchScrollViewer> + </Border> + </ControlTemplate> + </Setter.Value> + </Setter> + </Style> + + <Style TargetType="{x:Type ListBox}" x:Key="ListBoxVerticalScroll" BasedOn="{StaticResource BlankListBox}"> + <Setter Property="BorderThickness" Value="0"></Setter> + <Setter Property="VirtualizingPanel.ScrollUnit" Value="Pixel"></Setter> + <Setter Property="ItemsPanel"> + <Setter.Value> + <ItemsPanelTemplate> + <VirtualizingStackPanel IsVirtualizing="True" VirtualizationMode="Recycling" VirtualizingPanel.ScrollUnit="Pixel" /> + </ItemsPanelTemplate> + </Setter.Value> + </Setter> + <Setter Property="Template"> + <Setter.Value> + <ControlTemplate TargetType="{x:Type ListBox}"> + <Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}"> + <touch:TouchScrollViewer CanContentScroll="True" Padding="{TemplateBinding Padding}" Focusable="False" + + Style="{StaticResource TouchVerticalScrollViewer}"> <ItemsPresenter /> </touch:TouchScrollViewer> </Border> |
