我有以下“网格”:
<Grid x:Name="ImagesGrid" Grid.Row="1" >
<ItemsControl ItemsSource="{Binding FrameViewers}" />
</Grid>
我还有以下UserControl
项目集合:
private ObservableCollection<FrameViewer> m_frameViewers = new ObservableCollection<FrameViewer>();
public ObservableCollection<FrameViewer> FrameViewers
{
get => m_frameViewers;
set
{
m_frameViewers = value;
OnPropertyChanged();
}
}
我想动态添加FrameViewer
到我的屏幕,使其看起来像附加的图像:
我能够使用“网格”并在 中添加了一个StackPanel
,ItemSource
但随后它们都按标题的长度调整大小,并附加到Grid
我在这里想念什么?我错过了什么?