I
I
iRumba2015-05-08 12:26:27
WPF
iRumba, 2015-05-08 12:26:27

How to make Binding to Point X?

Hello. I make a successor from Button. I'm trying to draw on it two triangles (Polygon) looking up and down. In my control, I defined the width and height properties of the arrows and associated them with the grid rows. And the arrows should be drawn to the full size of these grid cells. Accordingly, I need to bind Points. So when you try to do it like this:

<Polygon Grid.Row="0" Stroke="Black">
            <Polygon.Points>
                <Point X="1" Y="{Binding ElementName=Row,Path=Height}"/>
*******
******
            </Polygon.Points>
        </Polygon>

I get the answer: binding cannot be set in the Y property of the point type
Help please.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman, 2015-05-09
@yarosroman

No way, because the binding in XAML is supported only by DependencyProperty, and here it is just a simple double property. About the arrows, look at the ComboBox style, where the arrow is drawn using Path, and it already has a width and height that support binding.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question