.NET Framework Developer Center >
.NET Development Forums
>
Windows Presentation Foundation (WPF)
>
Element layout arrangement?
Element layout arrangement?
- Say I have a grid or container with width 100, and I have 20 elements with width 10. Each element gets 1 row to itself, but needs to overlap with the elements above and below it. So element one position x = 0, element 2, x = 5, etc. etc. But the key here is that the width of 100 can change, and all the elements need to scale horizontally so the first one always starts at 0, and the last one always starts at width-10.So basically, if the user reduces the width of the window to 10, all the elements are perfectly lined up vertically, and as the width of the container increases the 20 elements all move horizontally by different amounts so they are still going in a straight diagonal.Hope this makes some kind of sense... if so is there a simple way to do this? Each one of my elements is a view with a viewmodel providing the data displayed in the element as well.
Answers
- This would be a perfect candidate for a custom panel.Examples: http://dotnet.org.za/rudi/archive/2008/04/15/why-wpf-rocks-custom-layout-panel-showcase.aspxIf you need help, just let me know.hth,Marcel
http://dutchmarcel.wordpress.com/- Marked As Answer byZhi-Xin YeMSFT, ModeratorSunday, November 08, 2009 4:51 PM
All Replies
- This would be a perfect candidate for a custom panel.Examples: http://dotnet.org.za/rudi/archive/2008/04/15/why-wpf-rocks-custom-layout-panel-showcase.aspxIf you need help, just let me know.hth,Marcel
http://dutchmarcel.wordpress.com/- Marked As Answer byZhi-Xin YeMSFT, ModeratorSunday, November 08, 2009 4:51 PM
- Hi Marcel,The second link you provided with the examples is dead :(Do you have a mirror site by chance or another site with good examples for a diagonal element panel?Thanks!
- Well, it's not dead, but it is a bit slow to load :-)Just keep trying...Marcel
http://dutchmarcel.wordpress.com/ Well, it's not dead, but it is a bit slow to load :-)
It would seem you have a better connection than mine :)Just keep trying...Marcel
http://dutchmarcel.wordpress.com/After about 5 timeouts, I managed to get enough to load to see the DiagonalPanel implementation- Cool! But no author, no link to source, no info at all.... :(- All the panels are contained in a showcase application (including source code) which you can download using the link at the end of the article:
http://dutchmarcel.wordpress.com/


