Strange notation for WPF Content
Currently I'm styling a WPF ScrollViewer a开发者_开发百科nd I found this
Content="M 0 0 L 4 4 L 0 8 Z"
reading the MSDN examples. Now I would realy like to know what this means, but I wasn't able to find an answer by asking google.
So can anyone tell me what this means?
Thx
This should help you out: http://msdn.microsoft.com/en-us/library/cc189041(v=vs.95).aspx
Such syntax is used to define a path (a figure). Usually such strings a specified in Data
property of Path
object. The syntax is described here.
The reason why it works when specified on the Content
property of a RepeatButton
(in a ScrollViewer
style) is hidden in the style of that RepeatButton
- ScrollBarLineButtonStyle
:
<RepeatButton Style="{StaticResource ScrollBarLineButtonStyle}"
...
Content="M 0 4 L 7 4 L 3.5 0 Z"/>
In that style you will find a Path
with its Data
property bound to the Content
property of a RepeatButton
:
<Path Data="{Binding Path=Content,RelativeSource={RelativeSource TemplatedParent}}"
.../>
It looks like it is a path markup
You can find the syntax here MSDN Path Markup Syntax
精彩评论