Custom Right Aligned StackPanel control layout in Silverlight -
I am trying to create a custom layout container, with the same feature of the stack panel, with the exception that this screen Items starting at the right edge of it is not right to say that it does not work properly.
I have identified a defect in ArrangeOverride (), where the line
point elementOrigin = new point (this. .formed size, 0);
Just makes a point 0, 0. In other words it Diazed Sisiiv With = 0. I understand that the phase of measure takes place before the arrangement stage, so I hope that this control sets the property of the desired property. How do I start the presentation from the right side of the screen? Is this also possible?
The second, final sys argument passed in the function is much larger than the required area for the three buttons which I have defined in the test xaml. By 1676 909 needs something, something 250 to 60 or something else Thank you.
This is my code:
Protected Override Size Measurements (Size Available) {Size Available Space = New Size (Double PositineFinity, Double Positininity); Desired size size = new size (0, 0); Foreign hair (children in Uilean children) {child.Measure (availableSpace); Desired. Shape. With + = child. Wide; Desired. Shape. Het = monastery Maximum (desired size. Height, child. Exiled size. Heights); } Return Base Measure override (desired size); } Organize protected override sizes Override (shape final shape) {point elementOrigin = new point (this.DesiredSize.Width, 0); Exotic hair (UiIlement children in this category) {Rit Childbowers = New Rick (Element, Child. Disney Size); ElementOrigin.X - = Child. Defined size. Wide; Child.Arrange (childBounds); } Return basis Arrangeoverride (final size); }
You should have your desiredSize
MeasureOverride
implementation, you do not want to call the base version of this method, you are replacing the default implementation with you.
Similarly, with ArrangeOverride
you are implementing, you are replacing the default implementation so that do not call the base version of this method. Just return the last size
.
Comments
Post a Comment