level 1
大佬们,想用控件来表示100个座位,其中每个座位用红绿色来表示男女并在上面显示ID,应该用什么控件,难道要用100个button?
2019年05月23日 09点05分
1
level 2
自定义个控件,然后用listbox的source绑定到你自定义的控件集合。这个自定义控件就是你要展现的座位样式
2019年09月26日 15点09分
6
level 2
<ItemsControl Height="Auto" Width="Auto" Grid.Row="2" HorizontalAlignment="Center" Background="Transparent" ItemsSource="{Binding PlatformInfos,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ItemTemplate="{StaticResource MenuChildDataTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Horizontal"></WrapPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
<DataTemplate x:Key="MenuChildDataTemplate" DataType="{x:Type 你的Model}">
<Button Content="{Binding Id}"></Button>
</DataTemplate>
2019年10月18日 06点10分
8