wrappanel

WPF : Reorder WrapPanel content via drag and drop?

最后都变了- 提交于 2019-12-03 09:16:43
问题 I am looking for a way to reorder the content (items) of a WPF WrapPanel via drag and drop. I just want to click on an item and drag it to a new position. To my understanding this is a very common task and I wonder I someone already did this or has any idea how to implement this functionality. I did a google search already but found nothing. Maybe it is more difficult than I expected. 回答1: I've written a library which may help: default behaviour is to allow re-ordering within the same control

Specify the max number of columns for a WrapPanel in WPF

这一生的挚爱 提交于 2019-12-03 05:02:56
I have a WrapPanel, And I want to specify the Max number of its columns. So, for example, when my Collection "ObjectCollection" (binded to this WrapPanel) contains only 4 elements, the WrapPanel will have only one row. But, when "ObjectCollection" will have 5 elements, the wrapPanel will create another row to put the fifth one. (My Max_Columns_Number in this case is 4). I'm pretty sure you can't do it with a WrapPanel , but you can use the UniformGrid instead. That one has properties to specify the number of rows and columns you want. If you set the Columns property to 4, it will keep 4 items

ListBox+WrapPanel arrow key navigation

柔情痞子 提交于 2019-12-03 03:42:54
I'm trying to achieve the equivalent of a WinForms ListView with its View property set to View.List . Visually, the following works fine. The file names in my Listbox go from top to bottom, and then wrap to a new column. Here's the basic XAML I'm working with: <ListBox Name="thelist" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding}" ScrollViewer.VerticalScrollBarVisibility="Disabled"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <WrapPanel IsItemsHost="True" Orientation="Vertical" /> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox> However, default arrow key navigation does not

WPF : Reorder WrapPanel content via drag and drop?

五迷三道 提交于 2019-12-03 00:49:44
I am looking for a way to reorder the content (items) of a WPF WrapPanel via drag and drop. I just want to click on an item and drag it to a new position. To my understanding this is a very common task and I wonder I someone already did this or has any idea how to implement this functionality. I did a google search already but found nothing. Maybe it is more difficult than I expected. I've written a library which may help: default behaviour is to allow re-ordering within the same control: http://code.google.com/p/gong-wpf-dragdrop/ Ah I notice you're talking about just a WrapPanel: you'll need

Synchronizing WPF control widths in a WrapPanel

久未见 提交于 2019-12-01 22:36:38
I have this case <WrapPanel> <CheckBox>Really long name</CheckBox> <CheckBox>Short</CheckBox> <CheckBox>Longer again</CheckBox> <CheckBox>Foo</CheckBox> <Slider MinWidth="200" /> </WrapPanel> I want all the CheckBoxes inside the WrapPanel to be the same width. Adding the following almost accomplishes the desired effect <WrapPanel.Resources> <Style TargetType="CheckBox" BasedOn="{StaticResource {x:Type CheckBox}}"> <Setter Property="MinWidth" Value="75" /> </Style> </WrapPanel.Resources> However, I do not want to hardcode a specific width, rather let the largest CheckBox set the width (the

WPF - Virtualising WrapPanel

白昼怎懂夜的黑 提交于 2019-12-01 20:58:35
does anyone have a functioning virtualising WrapPanel I can use in a WPF application? I have downloaded and tried the implementation at http://virtualwrappanel.codeplex.com/ . However, I get the following exception: "Layout measurement override of element 'MyNamespace.VirtualizingWrapPanel' should not return PositiveInfinity as its DesiredSize, even if Infinity is passed in as available size." This is when trying to apply the wrappanel to a ListBox This is probably a bug that you might be able to fix yourself. Look for the MeasureOverride method. It always seem to return the availableSize wich

Binding ObservableCollection items to UserControl in WrapPanel?

99封情书 提交于 2019-12-01 00:06:24
问题 I may just be missing something obvious here, so I apologize if this is a really dumb question. I have a WrapPanel in a view that I need to bind to an ObservableCollection on the ViewModel. This ObservableCollection contains a different type of ViewModel that needs to be bound to another type of view when displayed in the WrapPanel. The goal is to create a wrappable list of items, each of which displays via an instance of a smaller view which should be added to the WrapPanel. I am using MVVM,

List Items Vertically on a WrapPanel and take advantage of multiple columns

瘦欲@ 提交于 2019-11-30 11:23:45
I need to list items (all of same size) vertically (with a ScrollViewer). I want the items to spread through x columns if the container is large enough to display x columns I first tried that : <ScrollViewer> <toolkit:WrapPanel Orientation="Horizontal" ItemHeight="30" ItemWidth="100"> <Button Content="1" /> <Button Content="2" /> <Button Content="3" /> <Button Content="4" /> <Button Content="5" /> </toolkit:WrapPanel> </ScrollViewer> Result - The WrapPanel works like I want but my items are ordered from "Left to Right" (not vertically Then I tried to seet the Orientation of the WrapPanel to "

WPF wrap panel and scrolling

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 11:00:31
I have a simple WrapPanel which contains a number of wide controls. When I resize the Width of the Window everything works as expected. The controls will go across on a single line if there is enough space or wrap down to the next line when there isn't. However, what I need to happen is that if all of the controls are basically stacked vertically (since there is no more horizontal space) and the Width of the Window is decreased even more, a horizontal scroll bar appears so that I can scroll and see the entire control if I want to. Below is my xaml. I tried wrapping the WrapPanel in a

How to set WrapPanel itemsource to list?

北城以北 提交于 2019-11-30 08:45:16
I want to show in WrapPanel a list of images. How can I do that or maybe I shall use other control ? You can absolutely use the WrapPanel to show a list of images, scrolling vertically or horizontally. To get the kind of panoramic tile effect like in People hub with your images, you could do something like this: <controls:PanoramaItem Header="something" Orientation="Horizontal" Margin="0,-15,0,0" > <ListBox Name="SomeList" Margin="0,0,-12,0" ItemsSource="{Binding SomeItemsList}" > <ListBox.ItemsPanel> <ItemsPanelTemplate> <toolkit:WrapPanel x:Name="wrapPanel" Width="700" /> <