Live Chat Icon For mobile
Live Chat Icon

How do I access extended properties from a XAML tempalte?

Platform: WPF| Category: Styles and Templates

Here is how you would access a Canvas.Left extended property for example:


        <DataTemplate x:Key='MyTemplate1'>
            <Path Data='{Binding Geometry}'>
                <Path.RenderTransform>
		<!-- The Item property returns a visual hosted inside the Canvas -->
                    <RotateTransform Angle='60' CenterX='{Binding Item.(Canvas.Left)}' 
                                     CenterY='{Binding Item.(Canvas.Top)}' 
                                     >
                    </RotateTransform>
                </Path.RenderTransform>
            </Path>
        </DataTemplate>

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.