c# - WPF slider style -


I'm new to WPF, and I'm trying to add a style to my slider, but there are lots of options which I am confused in a way.

Someone can see how a slider looks at me: slider Green = passes, brown hair track

and I am trying to use it to show during the song, so the brown = balance, the easiest way is to apply it by dragging it That part of the song is skipped.

I am using Noudio, I have got trackback sliding, while the song is playing:

  Private zero sender timerTit (object sender, EventArgues e) {LabelCurrentTime.Content = _musicManager.getPlayTime (); Double Total Seconds = _musicManager.totalSeconds (); Double serials = _musicManager.currentSeconds (); If (total seconds & gt; 0 & amp; amp; amp; & amp; amp ;; currentseconds & gt; 0) trackbar Value = ((Trackbar.Width / totalseconds * currentseconds) / total second) * 10; Xaml:  
  slider with x: name = "trackbar" height = "25" canvas.lift = "50" canvas top =   

"10" width = "408" max = "10" />

Here you can go:

  public Partial square main window: window {public key window () {initial group (); } Private Zero Border_MouseDown (Object Sender, MouseButtonEventArgs E) {var mainborder = limit as sender; Double X = E. Gateposition (mainborder) .x; Double Val = 1 - (Main Border. Actual Wide - x) / Main Border Actual Wide; Slider. Value = Val * (Slider Max - Slider Minim) + Slider the minimum; }} Public Category SliderValueConverter: IMultiValueConverter {Convert Public Objects (Object [] Value, Type Target, Object Parameter, System.Globalization.CultureInfo Culture) {Double Val = (Double) Value [0]; Double min = (double) value [1]; Double max = (double) value [2]; Double slider width = (double) value [3]; Return slider wydath * (wal - min) / (max - min); } Public object [] Convertback (Object Value, Type [] Target Type, Object Parameter, System. Globalization.CultureInfo Culture) {New NotImplementedException (); }} & Lt; Window x: Class = "WpfTest.MainWindow" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http://schemas.microsoft.com/ Winfx / 2006 / Xaml "xmlns: local =" clr-namespace: wpfTest "heading =" main window "height =" 650 "width =" 825 "& gt; & Lt; Window.Resources & gt; & Lt; Local: Sliderwhole converter x: key = "slider valve converter" /> & Lt; /Window.Resources> & Lt; StackPanel & gt; & Lt; Slider Max = "200" min = "100" name = "slider" & gt; & Lt; Slider.Template & gt; & Lt; ControlTemplate TargetType = "{x: Type slider}" & gt; & Lt; Border background = "silver" height = "30" mouseDown = "bordermouse'dance" & gt; & Lt; Border background = "green" horizontal align = "left" & gt; & Lt; Border.Width & gt; & Lt; Multibind converter = "{static resource slider value converter}" & gt; & Lt; Binding Relative Source = "{ResolveSourceSmallized Paint}" path = "Value" /> & Lt; Binding Relative Source = "{Resultusaurus Templated Paint}" Path = "Minimum" /> & Lt; Binding Relative Source = "{ReservedSource TemplatePaint}" path = "max" /> & Lt; Binding Relative Source = "{relative protection typical paints}" path = "realode" /> & Lt; / MultiBinding & gt; & Lt; /Border.Width> & Lt; / Border & gt; & Lt; / Border & gt; & Lt; / ControlTemplate & gt; & Lt; /Slider.Template> & Lt; / Slider & gt; & Lt; / StackPanel & gt;   



Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -