[WPF](小结1)ListBox嵌套ListBox

这篇博客总结了在WPF中如何实现ListBox嵌套ListBox的绑定和使用技巧,详细介绍了主界面的绑定语句及其应用。
摘要由CSDN通过智能技术生成

 

 

 
 

 

 

 

 

 

 

 

 

 

 
思路:大项目的每项中包含一个小项目集合,用ListBox嵌套ListBox或ListBox嵌套ItemsCtrol是个比较好的方式,现总结如下:
第一:先构建题目类,再建一个选项类,题目类集合中的每个项包含一个选项类集合,即数组嵌套数组,C#语句如下:
(为方便看清语句,类直接写在主程序中)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Collections.ObjectModel;//ObservableCollection命名空间
namespace ListBoxInListBox
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
        //题目类
        class question
        {
            public string qutestionName//题目名,比如:第1题或第2题等
            { get; set
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值