Tokk
Tokk

Reputation: 4502

Strange notation for WPF Content

Currently I'm styling a WPF ScrollViewer and 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

Upvotes: 4

Views: 1085

Answers (3)

John Petrak
John Petrak

Reputation: 2928

It looks like it is a path markup

You can find the syntax here MSDN Path Markup Syntax

Upvotes: 1

Pavlo Glazkov
Pavlo Glazkov

Reputation: 20756

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}}"
      .../>

Upvotes: 1

Richard Pianka
Richard Pianka

Reputation: 3366

This should help you out: http://msdn.microsoft.com/en-us/library/cc189041(v=vs.95).aspx

Upvotes: 4

Related Questions