Questions tagged [measureoverride]
32 questions
14
votes
2 answers
Panel.Children vs Panel.InternalChildren -- What's the difference?
According to MSDN - Panel.InternalChildren Property:
Classes that are derived from Panel
should use this property, instead of
the Children
property, for internal overrides such
as MeasureCore
and ArrangeCore.
So, this is really a 2 part…

myermian
- 31,823
- 24
- 123
- 215
6
votes
2 answers
WPF MeasureOverride and ArrangeOverride
My question here is more of a theoretical one rather than functional. So what I'm looking for is an answer that can maybe be backed up with some documentation.
I find myself in the situation where I need to do some custom measurements/arrangements…

user1422535
- 749
- 1
- 6
- 11
6
votes
1 answer
WPF UserControl is not drawn when overriding MeasureOverride and ArrangeOverride
I have a UserControl looking like this:
In addition to the min/max size constraint,…
skylap
5
votes
1 answer
How can I change only a single option of a DependencyProperty's metadata in a subclass?
We need to override a DependencyProperty's metadata for our subclass. Now I know that I can use OverrideMetadata and specify entirely new FrameworkPropertyMetadata object, but for the most part I want this new metadata to be exactly the same as the…

Mark A. Donohoe
- 28,442
- 25
- 137
- 286
4
votes
2 answers
MeasureOverride and ArrangeOverride. What is really AvailableSize/DesiredSize?
I've been stuck for two days trying to understand the layout principles of WPF.
I have read a bunch of articles and explored the wpf source code.
I know that measure/measureoverride method accepts a availablesize and then sets the DesiredSize…

Tormod
- 4,551
- 2
- 28
- 50
3
votes
2 answers
Measure Control with double.PositiveInfinity WPF
I am working on a custom control that has a custom panel and inside the custom panel I have a small and simple MeasureOverride method that passes the size of double.PositiveInfinity to its children MeasureOverride method. The custom panel should…

cyberist
- 107
- 1
- 10
2
votes
2 answers
WPF - IScrollInfo implementation
The problem: An Window that has an ItemsControl with some items(let's say Rectangles).
The window has MinWidth and MinHeight setted(eg. 300)
I need that when I resize window if the rectangles has not enough space to be displayed to be displayed in 2…

Victor
- 260
- 1
- 3
- 13
2
votes
1 answer
FramworkElement Arrange not placing child FramworkElement
I have two classes [applicable to this question]. The first, XYAxes2, extends FrameworkElement. It overrides MeasureOverride and ArrangeOverride in an attempt to place it's sole child, XAxis (also extends FrameworkElement), in the desired…

Richard SP.
- 497
- 6
- 15
2
votes
1 answer
Subclassing FrameworkElement in Silverlight 4.0 - A Measure Pass Question
I currently have an issue in Silverlight where I want to detect the change in size for an element, and react to it. However, listening with .SizeChanged is actually not sufficient, as often I get a flash of the element at the size it's changing to,…

Melodatron
- 610
- 4
- 10
2
votes
1 answer
ArrangeOverride and Arrange() when are they called by the Layouting system?
I am trying to understand the layout system in Silverlight, but I don't really know how the process works. I know that Measure is always called before and then when all the measures have been done the arrange starts. But when exactly does this…

Adriana
- 225
- 3
- 8
2
votes
0 answers
How to set DesiredSize greater than ConstraintSize using MeasureOverride method
I have a custom control, which load inner control set based on user configuration. Inner control set can contain two types of controls - some of them has custom attached boolean property, which says that inner control can take only it's own desired…

Rudolf Dvoracek
- 904
- 2
- 14
- 30
2
votes
2 answers
MeasureOverride not always called on children's property changes
I wrote a panel similar to the built-in StackPanel. I works almost fine except for a slight problem:
Changing layout properties on children do not always cause the panel's MeasureOverride and ArrangeOverride to be called. They are always called when…

John
- 6,693
- 3
- 51
- 90
2
votes
5 answers
How to set DesiredSize.Width of a UIElement?
I need to calculate the Width of each UIElement in a custom panel. If looping over Children:
foreach (UIElement child in Children) { ... }
I can't do child.DesiredSize.Width = myCalculatedWidth; since DesiredSize and DesiredSize.Width are read…

Nicros
- 5,031
- 12
- 57
- 101
1
vote
1 answer
Why is a ListBoxItem not calling MeasureOverride when its width is changed?
Ok, for illustrative purposes, below I created a subclass of ListBoxItem and a subclass of ListBox which uses it as its container by overriding both IsItemItsOwnContainerOverride and GetContainerForItemOverride.
Now when the window first appears, as…

Mark A. Donohoe
- 28,442
- 25
- 137
- 286
1
vote
1 answer
WPF MeasureOverride called multiple times after multiple PropertyChanged notifications
In my application, I have a graph (Custom Wpf Panel) with Wpf controls as elements. The elements are custom controls derived from Wpf Control. DataTemplates associate the controls to their view models.
The view models collection, "GraphElements" is…

Chougule Vinay
- 61
- 1
- 7