I want to access Non-Public Member in windows store apps but i cant.
I want to access the "elements" in picture
I have a GridView
that binds to a collection for grouping as follows
private void gridview_1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
slidein_history_of_illness.DataContext = (sender as GridView).SelectedItem;
object obj = (sender as GridView).SelectedItem;
}
The ItemSource
of my GridView
is GridViewItemSoure
:
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);
}
I solved that!
I access elements with this lines!
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
}
}