链接到列表视图的自定义简单滚动条
列表视图的默认滚动条显示在右侧。我设计了一种新样式,希望它与列表视图控件分开显示。您在图像中看到的是我现在使用混合进行设置的方式。
那么如何将自定义滚动条链接到列表视图呢?我正在使用 Blend 4。
列表视图图像位于此处:
http://i141.photobucket .com/albums/r69/thebirdbath/scroll.jpg
The default scrollbar for a listview appears at the right. I designed a new style and would like it to appear separate from the listview control. What you see in the image is how I have it set up now using blend.
So how do I link the custom scroll bar to the listview? I'm using Blend 4.
Listview Image located here:
http://i141.photobucket.com/albums/r69/thebirdbath/scroll.jpg
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不确定您是否要将样式添加到
ListView
的Template
内的ScrollViewer
中,或者是否要禁用该 < code>ScrollViewer 并将ListView
放置在单独的ScrollViewer
中。要将
Style
应用于Template
中的ScrollViewer
并将ScrollBar
放置在左侧,您可以修改默认值使用GridView
时的模板
。它将需要引用 PresentationFramework.AeroScrollViewer
上设置FlowDirection="RightToLeft"
以将其放置在左侧
因为它们将继承ItemsPresenter
和GridViewHeaderRowPresenter
上的 FlowDirection="LeftToRight"RightToLeft
否则ScrollViewer
和内容之间的透明空间,请为ListView
设置Background="Transparent"
并设置所需的
改为ItemsPanel
上的背景Padding
控制透明空间,例如Padding="0,0,10,0"
外观像这样
I'm not sure if you want to add your Style to the
ScrollViewer
inside theTemplate
of theListView
or if you want to disable thatScrollViewer
and place theListView
in a separateScrollViewer
.To apply the
Style
to theScrollViewer
in theTemplate
and place theScrollBar
to the left you can modify the defaultTemplate
when usingGridView
. It will require a reference to PresentationFramework.AeroFlowDirection="RightToLeft"
on theScrollViewer
to place it on the left sideFlowDirection="LeftToRight"
on theItemsPresenter
andGridViewHeaderRowPresenter
since they will inheritRightToLeft
otherwiseScrollViewer
and the content, setBackground="Transparent"
for theListView
and set the desiredBackground
on theItemsPanel
insteadPadding
, e.g.Padding="0,0,10,0"
Looks like this
好的,非常接近。它可以工作,但我丢失了列标题。另外,我无法获得栏和列表视图之间的透明度。就像酒吧仍然连接着一样,我希望它们看起来像是分开的。 (请参阅我的原始图像的链接)
这非常有帮助。快到了!
我的代码如下。
Ok, pretty close. Its working but I've lost my column headers. Also I can't get the transparency in between the bar and the listview. Its like the bar is still attached and I want them to appear like they are separate. (See the link to my original image)
This has been very helpful. Almost there!
My code is below.