gpt4 book ai didi

c# - Windows 商店中的非公共(public)成员(member)访问权限

转载 作者:太空宇宙 更新时间:2023-11-03 15:27:43 25 4
gpt4 key购买 nike

我想在 Windows 商店应用程序中访问非公共(public)成员(member),但我不能。

enter image description here

我要访问图片中的“元素”

我有一个 GridView 绑定(bind)到一个集合以进行分组,如下所示

private void gridview_1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
slidein_history_of_illness.DataContext = (sender as GridView).SelectedItem;
object obj = (sender as GridView).SelectedItem;
}

我的 GridViewItemSourceGridViewItemSoure:

List<GroupInfoList<object>> GridViewItemSoure = new List<GroupInfoList<object>>();

var query = from item in Collection
orderby ((Item)item).name
group item by ((Item)item).name into g
select new { GroupName = g.Key, Items = g };

foreach (var g in query)
{
GroupInfoList<object> info = new GroupInfoList<object>();
info.Key = g.GroupName;

foreach (var item in g.Items.GroupBy(x=>((Item)x).color))
info.Add(item);

GridViewItemSoure.Add(info);
}

最佳答案

我解决了!

我用这行访问元素!

private void gr_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
object obj = (sender as GridView).SelectedItem;
IGrouping<string, object> groupCast = obj as System.Linq.IGrouping<string, object>;
foreach (Item item in groupCast)
{
//to do staff
}
}

关于c# - Windows 商店中的非公共(public)成员(member)访问权限,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34576324/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com