简体   繁体   English

标记的Scrollbar,就像在Visual Studio中一样

[英]Tagged Scrollbar like in Visual Studio

I need to implement a WPF Application which has to use the scrollbar like Visual Studio. 我需要实现一个必须使用像Visual Studio这样的滚动条的WPF应用程序。 That means it should tag regions of the scrollbar such as Warning, Error, Information etc. 这意味着它应该标记滚动条的区域,例如警告,错误,信息等。

Upon clicking on the tag it should scroll to the corresponding item on the pane/datagrid/whatever. 点击标签后,它应滚动到窗格/ datagrid /上的相应项目。

Visual Studio滚动条

What would be the proper way to perform this? 执行此操作的正确方法是什么? Is there and API/ Control Library out there to achieve this? 是否有API和控制库可以实现这一目标?

Well since there were no reactions overall, I would like to post my own thoughts about this requirement. 好吧,因为总体上没有任何反应,我想发表自己对这个要求的想法。 Maybe this will be of help to anybody. 也许这对任何人都有帮助。

The longer I thought about this I became clearer, that the Visual Studio Toolbar is simply a different representation of the source file which has been broken down to some details of interest. 我想到的时间越长,我就越清楚了,Visual Studio工具栏只是源文件的不同表示,已经分解为一些感兴趣的细节。 In the case of Visual Studio these are errors, code smells etc. In the easiest of all cases you simply can put a ListView above the Scrollbar or even the whole view and fix it to its width. 在Visual Studio的情况下,这些是错误,代码气味等。在最简单的情况下,您只需将ListView放在滚动条上方甚至整个视图并将其固定到其宽度。 Elements within this ListView can be small dashes in different colors with are registered to some kind of click event/command. 此ListView中的元素可以是不同颜色的小破折号,并注册到某种点击事件/命令。 When executed, it enables the scrollbar scrolls to the appropriate location. 执行时,它会使滚动条滚动到适当的位置。

Since we are using glorious Caliburn.Micro in our project, we will represent this view with a different context and provide some solution as above mentioned. 由于我们在项目中使用了光荣的Caliburn.Micro,因此我们将使用不同的上下文来表示此视图,并提供上述解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM