For a customer project I'm working on currently, I needed a more precise WPF container. I need to place controls on a position on the panel, where the center of the control has a meaning to the user. This means that the positioning has to take into account the height of the control.
The WPF Canvas implementation has the attached property Canvas.Top, which makes sure the outer top of the control is at a given position. Of course this doesn't take into account the fact that a control has a Height.
I then looked into creating a custom panel, and expected it to be tough. It turned out to be quite simple.
You start out by overriding MeasureOverride, in which a panel measures its children and itself. Next is ArrangeOverride, in which the panel arranges the children in the rectangle passed as the first parameter (finalSize). Arranging children is then quite easy, first you retrieve the desired center position (attached property), then you subtract the Height/2 of the control, and use that to call child.Arrange.
dinsdag 22 juni 2010
zaterdag 19 december 2009
FW: Core Module
As described in my first blog post, I'm going to give you a background about all important modules. This blog post explains what the Core module does.
Labels:
Framework,
Framework.Next
vrijdag 18 december 2009
Intro to myself and the Framework.Next project
I'm a full time student Business Informatics at the Saxion University in Enschede, the Netherlands. Since i'm about 10 years old, me and my dad make custom software solutions for customers in our free time. This is done using a self-built framework in Delphi 6. Now I'm working on a new framework built using .NET 4, and C#. My other pet project is Cosmos. Together with Chad Z. Hower, I started this project in 2006. These two projects will be the main topic of my blog.
Before posting all kinds of random snippets of ideas to my blog, I thought it might be a good idea to first give a overview and general idea of the framework.
One major "problem" I have with our current application development, is that if we want to reuse parts of a project in another one, we just copy the relevant sources. This means we have to support both "branches" at that point. Not ideal world.
There are some other issues, but those will be explained below.
My new framework, I will call it Framework.Next, is mainly developed to overcome these issues. In the coming blogposts, I will describe exactly how I overcome the issues.
Framework.Next is built up around an ObjectTree. This object tree provides a way to store objects in a hierarchical way, similar to a filesystem. This ObjectTree is what makes almost all things possible, which are helping me to prevent the issues I have with our current framework.
The functionality in Framework.Next is grouped into so-called Modules, each consisting of one or more assemblies.
The following modules exist, and will be described in coming blogposts:
Before posting all kinds of random snippets of ideas to my blog, I thought it might be a good idea to first give a overview and general idea of the framework.
One major "problem" I have with our current application development, is that if we want to reuse parts of a project in another one, we just copy the relevant sources. This means we have to support both "branches" at that point. Not ideal world.
There are some other issues, but those will be explained below.
My new framework, I will call it Framework.Next, is mainly developed to overcome these issues. In the coming blogposts, I will describe exactly how I overcome the issues.
Framework.Next is built up around an ObjectTree. This object tree provides a way to store objects in a hierarchical way, similar to a filesystem. This ObjectTree is what makes almost all things possible, which are helping me to prevent the issues I have with our current framework.
The functionality in Framework.Next is grouped into so-called Modules, each consisting of one or more assemblies.
The following modules exist, and will be described in coming blogposts:
- Core
- DataAccess and PersistentDataAccess
- ObjectFactory
- UI
- DataViews
- BL
Labels:
Framework,
Framework.Next
Abonneren op:
Posts (Atom)