问题标签 [wrappanel]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
2019 浏览

wpf - WPF 中具有可调整大小控件的类似网格的 WrapPanel

我想制作一个带有包装面板行为和可调整大小控件的网格,我该怎么做?也许在图像中显示我想要的内容更容易:

初始状态:

在此处输入图像描述

使用右下角调整控件 1 的大小,使其占用大约 2x2 个单元格,然后控件 2 等将重新排列它在网格上的位置:

在此处输入图像描述

当它重新调整大小时,它应该回到初始状态。

0 投票
1 回答
2458 浏览

silverlight-4.0 - ItemsControl 中的 WrapPanel 添加了 ScrollViewer 导致失去包装行为

我正在使用 ItemsControl 中的 ItemsPanel 中的 WrapPanel。只要添加的物品适合尺寸,这就会完美。为了满足内容超出大小的情况,我添加了一个ScrollViewer。但是现在这些项目仅垂直列出,即使它们都适合。任何想法是否可能以及我必须做什么。

这是我的xml:

0 投票
2 回答
4512 浏览

.net - 动态添加和删除堆栈面板

在此处输入图像描述

我在(灰色背景)中有一个WrapPanel(绿色背景ListBox)。

我正在尝试StackPanelWrapPanel.

StackPanel包含Button具有内容“X”的a。StackPanel单击此按钮时,我想删除单个对象(具有橙色背景)。

如何解决?

0 投票
1 回答
4397 浏览

wpf - WrapPanel 中的 VerticalAlignment - 如何使其正常工作?

我有一个奇怪的问题。

这是情况。我有一个ListView, 定义了一个自定义GroupStyle来使数据出现在Expanders 中,其中有一个WrapPanel包含StackPanels(其中包含一个 ToggleButton + 一个自定义控件) 中的自定义控件StackPanel默认情况下是不可见的,并且在ToggleButton选中时变为可见。但是,当我检查 a 时ToggleButton,会出现自定义控件,并且位于同一行的所有其他控件将移动到垂直中心。理想情况下,我希望这些其他成员保持领先。我试图设置VerticalAlignment="Top"任何我可以设置的地方,它无论如何都不会改变。

图像问题:

扩展器的初始状态:

之前的扩展器

ToggleButton单击 后,会发生以下情况:

后扩展器

如您所见,“测试分析​​”按钮移动到了中心。我希望它与原版保持在同一个地方。

此外,我已经在单独DataTemplate的 s 对象中定义了所有这些样式。这是一些简单的代码(我只是在这里删除了对问题无用的内容,不会让您阅读大量 XAML 代码:)):

扩展器的内容属性:

名单的ItemsPanel

名单的ItemsTemplate

0 投票
1 回答
3767 浏览

windows-phone-7 - 在列表框中包裹面板

我有以下 XAML 代码:

FriendsList宽度为 420 像素。

我的问题是:我想要两个项目列,但我看到一个。

有什么建议吗?

0 投票
3 回答
887 浏览

silverlight - 带有 Wrappanel 的列表框不会显示元素

我很困惑为什么当我为我的 Silverlight 4 ListBox ItemsPanel 放入 WrapPanel 时,什么都没有显示。如果我只注释掉 ItemsPanel,我会得到一个带有文本的小图片的正常垂直列表。我将背景颜色添加到 WrapPanel 只是为了让自己相信 WrapPanel 确实存在。我想我错过了一些愚蠢的东西,那是什么?

0 投票
1 回答
909 浏览

wpf - 在 WrapPanel 中共享可用空间

我在 WPF 中使用 WrapPanel 来显示图像。在调整表单大小时,这些图像试图占据最大的空闲空间,但是当图片几乎可以填满空间时,WrapPanel 的末端有一个比较大的间隙。我想做的是在新的图像填补这个空白之前在图像之间共享这个空间(就像 Windows 7 Explorer 在显示图像图标时所做的那样)。

0 投票
1 回答
7489 浏览

.net - Making a WrapPanel respect his parent's width

Ok here's my code. Note that the StackPanel is directly in a UserControl.

(Code EDITED)

Note that the rectangle is just there because the content of that scroll viewer is irrelevant.

The problem is that the WrapPanel just expands horizontally and doesn't wrap...

I found a few solutions:

  1. Giving absolute width to the WrapPanel (but then it doesn't resize with the window).

  2. Binding width to its parent width - either ItemsControl or ScrollViewer (ScrollViewer worked better in a limited situation like this one).

    /li>

The problem with this technique is that if a control is beside it in a StackPanel or Grid, you need to bind it to it's parent size minus the control next to it. Then comes the hard stuff. I built a converter which applies mathematical operations on the number received so I could subtract a given width from its parent width:

But still, since you can't bind a value you pass to a ConverterParameter,

I want:

  • to be able to resize my app with my WrapPanel and ScrollViewer resizing well,
  • my UserControl to be easily maintainable,
  • my code cleaner than these big binding expressions which rely on parent control's Type.

What's a better solution?

Note: If anything isn't clear, I can add detail.

0 投票
1 回答
3993 浏览

c# - 如何在 wrappanel 中设置两个对齐

我怎样才能得到如下图所示的包装板?两个按钮 < > 和文本块向左对齐,文本框向右对齐,当我调整窗口的宽度时,文本框自动换行。

0 投票
2 回答
790 浏览

silverlight - 包装面板中的 Silverlight 缩放列表框项目

我创建了一个带有平铺数据模板的列表框。我现在想弄清楚的是,当鼠标悬停或选定事件发生时,如何正确地将缩放效果应用于每个列表框项,并让它在换行面板中正确呈现。我目前已将动画添加到 ListBoxItemTemplate 的视觉状态中。

一些想法:当动画被调用时,包装面板中的瓷砖不要重新定位以允许正确查看缩放的项目。我想让包裹面板中的项目重新定位,以允许缩放的项目可见。

另外我注意到缩放时的项目超出了包裹面板的边界,有没有办法在缩放时将项目限制在包裹面板的可视区域?

搜索视图中使用的代码

ResultsItemsControlPanelTemplate 在 app.xaml 中定义为

我将不胜感激任何关于在哪里看的建议提前谢谢

当前结果的图像

在此处输入图像描述