Friday, 15 August 2014

c# - Thumb control highlighted and dragging appearance -


I am using thumb controls in a window store app to represent a drag-able image. However, whenever I hook it up, it turns into a gray box, and when I pull it, it turns into a dark brown box. When it is released, it takes the image back as I gave it in the background, is there any way to remove highlighting / highlighting or remove the highlight?

Edit:

Here's my XML for control. I have it in the grid but nothing is with it.

  & lt; Canvas x: name = "PART_background" background = "white" height = "140" width = "20" & gt; & Lt; Thumb X: name = "PART_drag" canvas. Lift = "0" width = "20" height = "50" & gt; & Lt; Thumb.BorderBrush & gt; & Lt; Solid color brush color = "black" opacity = "0" & ​​gt; & Lt; / SolidColorBrush & gt; & Lt; /Thumb.BorderBrush> & Lt; Thumb.Background & gt; & Lt; ImageBrush x: name = "PART_image" section = "none" AlignmentX = "center" /> & Lt; /Thumb.Background> & Lt; / Thumbs & gt; & Lt; / Canvas & gt; If you want to edit the template - it works best in Blend, then change the visuals are some  Border  element in the animation default template and various scenes (Pointrpres, Pointrovr) - it in Animates the opacity of the boundaries. Here is the template extracted. You can easily remove the storyboard to get rid of visual feedback.  
  & lt; Page x: Class = "App132.MainPage" xmlns = "http://schemas.microsoft.com/winfx / 2006 / xaml / presentation" xmlns: x = "http://schemas.microsoft.com/winfx/2006/ Using xaml "xmlns: local =": App132 "xmlns: d =" http://schemas.microsoft com / expression / blend / 2008 "xmlns: mc =" http://schemas.openxmlformats.org/markup- Compatibility / 2006 "mc: Ignorable =" d "& gt; & Lt; Page.Resources & gt; & Lt; Style x: key = "thumbstyle1" target type = "thumb" & gt; & Lt; Setter property = "background" value = "{static resources thumb backgroundThebrish}" /> & Lt; Setter property = "borderline" value = "1" /> & Lt; Setter Property = "iTebstop" value = "False" /> & Lt; Setter property = "borderbrush" value = "{static resource thumbboardthemebrush}" /> & Lt; Setter Estates = "Template" & gt; & Lt; Setter.Value & gt; & Lt; ControlTemplate Goal Type = "Thumbs" & gt; & Lt; Grid & gt; & Lt; VisualStateManager.VisualStateGroups & gt; & Lt; VisualState Group x: Name = "General Location" & gt; & Lt; VisualState X: Name = "General" /> & Lt; VisualState X: Name = "Pointer Over" & gt; & Lt; Storyboard & gt; & Lt; Double animation duration = "1" storyboard for "0" TargetProperty = "Opacity" storyboard. TargetName = "BackgroundPointerOver" /> & Lt; Double animation duration = "0" from "0" storyboard. TargetSprint = "Opacity" storyboard Target = "background" /> & Lt; / Storyboard & gt; & Lt; / VisualState & gt; & Lt; VisualState X: Name = "Pressed" & gt; & Lt; Storyboard & gt; & Lt; Double animation duration = "1" storyboard for "0" TargetSprint = "Opacity" storyboard Target = "page-restricted" /> & Lt; DoubleAnimation Term = "0" to = "0" Storyboard.TargetProperty = "Opacity" Storyboard.TargetName = "Background" /> & Lt; / Storyboard & gt; & Lt; / VisualState & gt; & Lt; VisualState X: Name = "Disabled" /> & Lt; / VisualStateGroup & gt; & Lt; VisualStateGroup x: Name = "FocusStats" & gt; & Lt; VisualState X: Name = "Unfoxide" /> & Lt; VisualState X: Name = "Focus" /> & Lt; / VisualStateGroup & gt; & Lt; /VisualStateManager.VisualStateGroups> & Lt; Border x: Name = "background" Borderbrs = "{Templetbading Borderbris}" Bordertiksaij = "{without border partition}" background = "{Binding background}" / & gt; & Lt; Limit x: Name = "BackgroundPointerOver" BorderBrush = "{StaticResource ThumbPointerOverBorderThemeBrush}" BorderThickness = "{TemplateBinding BorderThickness}" background = "{StaticResource ThumbPointerOverBackgroundThemeBrush}" opacity = "0" / & gt; & Lt; Limit x: Name = "BackgroundPressed" BorderBrush = "{StaticResource ThumbPressedBorderThemeBrush}" BorderThickness = "{TemplateBinding BorderThickness}" background = "{StaticResource ThumbPressedBackgroundThemeBrush}" opacity = "0" / & gt; & Lt; / Grid & gt; & Lt; / ControlTemplate & gt; & Lt; /Setter.Value> & Lt; / Setter & gt; & Lt; / Style & gt; & Lt; /Page.Resources> & Lt; Grid Background = "{Static Resources Software Application Background BackgroundThebrish}" & gt; & Lt; Thumb HorizontalAlignment = "left" height = "270" Margin = "170,230,0,0" VerticalAlignment = "top" width = "390" style = "{StaticResource ThumbStyle1}" / & gt; & Lt; / Grid & gt; & Lt; / Page & gt;    

No comments:

Post a Comment