-2
當選擇所有手段重命名所有複選框被選中。我的代碼如下:如何在wp8的列表框數據源中檢查所有的複選框?
<ListBox Name="VillageList">
<ListBox.ItemTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding isCheched}" Content="{Binding Villages}" IsChecked="False"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
所以所有複選框都在listbox.how中進行檢查,對所有複選框啓用單選。
public class villageinformation
{
public string Villages{get;set;}
public bool isChecked {get;set;}
}
page.cs{
list<villageinformation> mydataSource=new list<villageinformation>();
myDataSource.Add(new villageinformation(){Village="All",isChecked ="False"});
myDataSource.Add(new villageinformation(){Village="name1",isChecked ="False"});
myDataSource.Add(new villageinformation(){Village="name2",isChecked ="False"});
myDataSource.Add(new villageinformation(){Village="name3",isChecked ="False"});
VillageList.itemSource=myDataSource;
}
因此而手動點擊「全部」複選框,其餘name1,2,3選擇如何做到這一點?
顯示代碼o列表框和你的數據源,並顯示你如何數據綁定。 – nkchandra 2013-03-07 07:18:54
看看這個http://stackoverflow.com/questions/18912623/how-to-get-checked-checkbox-content-in-windows-phone-app/41542387#41542387 – Cloy 2017-01-09 06:47:31