wpf controls - WPF ScrollViewer show border when ScrollBar is Visible -



wpf controls - WPF ScrollViewer show border when ScrollBar is Visible -

i want add together border scrollviewer. order should shown when scrollbar of scrollviewer visible (verticalscrollbarvisibility set "auto")

thanky you!

use binding , converter.

public sealed class visibilitytoborderthicknessconverter : ivalueconverter { public object convert(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { seek { var flag = (visibility)value; if (flag == visibility.visible) homecoming new thickness(0); else homecoming new thickness(1); } grab { homecoming new thickness(0); } } public object convertback(object value, type targettype, object parameter, system.globalization.cultureinfo culture) { throw new notimplementedexception(); } }

and xaml:

<scrollviewer name="blah"> <border borderthickness="{binding elementname=blah, path=verticalscrollbarvisibility , converter={staticresources visibilitytoborder}}"> </scrollviewer>

don't forget add together converter resources!

gl&hf

wpf wpf-controls binding scrollviewer

Comments

Popular posts from this blog

iphone - Dismissing a UIAlertView -

intellij idea - Update external libraries with intelij and java -

javascript - send data from a new window to previous window in php -