Advanced Forum Search Results
-
You need to add the extension method that is defined in the blog post that I linked to.
-
Take a look at this blog post:
http://blogs.msdn.com/kmahone/archive/2009/03/29/visualtreehelper.aspx
Using the code from that post, you can do:
var taggedElements = Application.Current.RootVisual.GetVisuals().OfType<FrameworkElement>().Where(fe => fe.Tag != null).ToList();
This will return a list of all the elements in the visual tree ...
-
If you have a class called MyClass that needs to acess the row definitions of a Grid, you need to pass that Grid to the class, e.g. through the constructor.
So, the constructor of MyClass would take a parameter of type Grid, and when you create an instance of MyClass you pass a reference to the appropriate Grid. The MyClass can then examine ...
-
Be careful using the LayoutUpdated event. This is a global event across the entire silverlight application and it will be fired when the layout of any element in the visual tree gets updated. This is likely not what you want and you should instead should use the SizeChanged event, which is fired on an element by element basis.
-
You will need to:
a. Expose the "LayoutRoot" as a public property on your UserControl class
b. Pass a reference to the UserControl instance to the class that you want to access it from.
-
Hi CaCO3,
Both of the screenshots that you linked to are the same. It is difficult to diagnose your problem without actually seeing the code you used; if you could post the full source to your panel I could take a look at it.
One thing I would say: in the comments in the code you provided, you state that you call Arrange on every child in ...
-
You should take a look at the VisualTreeHelper class, in particular the GetChild and GetChildrenCount methods. Using these two methods should be able to solve the problem that you are facing.
-
That does not sound right; the ComboBox visuals should update if you change the SelectedIndex. If it is possible, it would be great to take a look at some code/xaml that exhibited this behaviour so I could determine if there is a bug in the platform.
-
And I just noticed that you don't even need to wrap the ListBox in a Border. You can set the BorderThickness to "4 0 0 0" directly on the ListBox.
-
Did you try changing the SelectedIndex propery on the ComboBox control?