列表框与多个控制

编程入门 行业动态 更新时间:2024-10-13 22:24:24
本文介绍了列表框与多个控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

有人可以帮我在创造一个复选框和星级控制水平对齐一个列表框?我使用C#和XAML想为WP7。

Can somebody help me out in creating a listbox with a checkbox and star rating control align horizontally? I want it for WP7 using C# and XAML.

推荐答案

您需要在这里编写一个自定义列表是一个例子:

You need to code a custom list here is an example:

您需要包括ControlToolkit:

You need to include ControlToolkit:

xmlns:ControlsToolkit="clr-namespace:System.Windows.Controls"

和这里是代码:

<ListBox x:Name="listBox" SelectionMode="Multiple" ItemContainerStyle="StaticResource ListBoxCheckedStyle}"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel Orientation="Horizontal"> <CheckBox Checked="{Binding YourPropertyPath}"/> <TextBlock Text="{Binding Name}" Width="150" VerticalAlignment="Center"/> <ControlsToolkit:Rating Height="50" Grid.Row="0" x:Name="rating" ItemCount="5"> <ControlsToolkit:Rating.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/> </ItemsPanelTemplate> </ControlsToolkit:Rating.ItemsPanel> </ControlsToolkit:Rating> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox>

您可以从这里下载示例:的 DownloadSample

You can download sample from here: DownloadSample

或点击这里查看详细信息: 示例网站

or check details here: Sample site

您可以获得这些详细:的 CustomDataTemplateSelector 的 WP7经过ListBox中以不同的方式的。

You can get more detail on these: CustomDataTemplateSelector WP7 Checked ListBox in different ways.

更多推荐

列表框与多个控制

本文发布于:2023-11-07 00:12:03,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1565027.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:多个   列表

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!