wpf 数据绑定到xaml

2024-12-13 22:11:51
推荐回答(1个)
回答1:

    
        
            
                
                    
                

            

        
    
        public MainWindow()
        {
            InitializeComponent();
            Dictionary dic = new Dictionary
            {
                {"1","11"},
                {"2","22"},
                {"3","33"},
                {"4","44"}
            };
            this.lst1.ItemsSource = dic;
        }