Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

WPF PolarPanel

0.00/5 (No votes)
26 Jan 2008 1  
A WPF panel for easily positioning elements in polar coordinates
PolarPanel.jpg

Introduction

The PolarPanel is a WPF derived Panel which allows easy positioning of elements in polar coordinates. With polar coordinates, instead of setting X and Y, you set Angle and Radius for each child element.

Using the Code

Coordinate setting is done by setting the attached Angle and Radius properties of the PolarPanel class on a child element.

  • Angle (in degrees) specifies the angle between the positive X line and the line between the panel center and element center.
  • Radius specifies the distance between panel center and element center.

For example:

<panels:PolarPanel> 
    <Button Content="12" panels:PolarPanel.Angle="90" panels:PolarPanel.Radius="50" /> 
    <Button Content="1" panels:PolarPanel.Angle="60" panels:PolarPanel.Radius="50" /> 
    <Button Content="2" panels:PolarPanel.Angle="30" panels:PolarPanel.Radius="50" /> 
...
</panels:PolarPanel>

History

  • 26th January, 2008: Initial post

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here