itemspanel

WPF - ItemTemplate not acting as expected.

I have a UserControl which I'm using to display a list of UIElements. The control consists of a single ItemsControl with it's ItemPanelTemplate switched for a horizontal StackPanel, its ItemsSource bound to a DependencyProperty exposed by the UserControl and its ItemTemplate set in the UserControl.Resources. Everything works fine exc...

ElementFlow: Exception in MeasureOverride

I'm trying to use FluidKits ElementFlow-control in my application, but get an exception in the MeasureOverride method of ElementFlow. Layout measurement override of element 'FluidKit.Controls.ElementFlow' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size. In the sample applicatio...

WPF ItemsPanelTemplate not working

I'm trying to get an ItemsPanelTemplate working for a ListBox. The ListBox is used in a DataTemplate, and none of my implicit ListBox styles override the default visual style. For some reason, the ItemsPanelTemplate I'm specifiying for the control (a WrapPanel) is being ignored and a StackPanel is used instead. This is the entire templa...

Weird ItemsPanelTemplate issue (possible Silverlight bug?)

Hi I'm trying to create a horizontally oriented stack panel that contains a vertically oriented stack panel of items. Here's my code. First the XAML <UserControl x:Class="SilverlightApplication1.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="...

How to make ListView change ItemControl to VirtualizingStackPanel at runtime

OK, so, I have a ListView-derived control that changes Grouping and ItemsSource on the fly. When I group such that the scrollbars dissapear, and then change my ItemsSource to a different ICollectionView, my scrollbars do not return. The basic problem is that ListView changes to a VirtualizedStackPanel when grouping is activated and d...

WPF change ItemsPanel and ItemTemplate in code behind

Hi, I have the following list in XAML: <ListView Name="ListViewBack" Margin="3" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ItemsPanel="{StaticResource IconListPanelTemplate}" ItemTemplate="{StaticResource IconListDataTemplate}"> </ListView> Now I would like to be able to change the I...

How to obtain the panel within a treeview (WPF)

How can one obtain the panel that is used within a TreeView? I've read that by default TreeView uses a VirtualizingStackPanel for this. When I look at a TreeView template, all I see is <ItemsPresenter />, which seems to hide the details of what panel is used. Possible solutions: 1) On the treeview instance ("tv"), from code, do this:...

WrapPanel as ItemPanel for ItemsControl

Still fooling around with WPF and learning as I go. Trying now to build a dynamic grouping of controls ( mostly buttons but might include checkboxes and others ). I had no idea what was the best way to do this so I tried creating a ItemsControl style and then add the items into a itemspresenter inside a wrappanel. Soon realized the item...

WPF: Changing the layout of Tabs in TabPanel

Instead of at the top I wan't my tabs on the left side. I changed the template for the the TabControl so that the TabPanel would appear in first column and the second column would host the content. Problem is I'm not sure how I change the TabPanel's layout so the tabs appear stacked vertically. I know in normal ItemsControl objects its...

Silverlight's ItemsControl Canvas.TopProperty and Canvas.LeftProperty not used

Hi, I want to create a canvas where a user can drop UI elements (representing tasks). He can then drag them to rearrange them. The elements are contained in an ObservableCollection that is the DataContext. I can set the Left and Top properties of the Canvas, but the objects position is not affected. Any ideas? Thanks, Karel UPDATE...

ItemsControl, ItemsPanel and ItemsPresenter (Silverlight, XAML)

I'm utterly confused by these 3 terms, when to use which? What's the relationship and they are children of which controls? Is it correct to say this is the tree: ItemsControl > ItemsPresenter > ItemsPanel ...

Use Radial Panel in Listbox, throwing exception VisualTree Single Element

Hi Guys, I have a very simple radial panel with a few dependency properties like so: public static readonly DependencyProperty RadiusProperty = DependencyProperty.Register("Radius", typeof(double), typeof(CircularPanel), new PropertyMetadata(50.0, new PropertyChangedCallback(RadiusChanged))); private static void RadiusChanged(Dependen...