Hi, I am playing around with your Xamarin Android sample, trying to figure out the logic of it all.
Yes, already got that about the UI for the ListView UI, I am now able to generate a click event on the ListView as follows:
DataSourceGettingStarted.cs
public override Android.Views.View GetSampleContent(Android.Content.Context context)
{ ... listView.ItemClick += ListView_ItemClick; ... }
private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
int idx = e.Position; //selected item index
Bitmap img = mContacts[idx].FlagImage; //image stored
imgView.SetImageBitmap(img);
GlobalVar.GImgView = imgView;
???
}
For the remainder, I figure that I should start a new activity which is using a new ImageViewer.axml (using a ImageView UI full screen) for the Image Viewer, and recall that Global variable to place that picture in the ImageView UI. Am I getting it right? Any input would be more than appreciated, any simpler way to do it?
Take care,
Nicolas
N.B. While we are on the datasource page, how can we can we extract data from a datasource, I can perform a first level to get the row, but not field in it : for example Bitmap img = mDataSource.Items[idx].("FlagImage")
var item = mDataSource.Items[idx]
var value = item.GetType().GetProperty("FlagImage").GetValue(item); |
ok, yes pretty same approach as VB .Net in syncfusion win forms apps, I remember this GetValue, it's pretty direct, I used it quite a lot, I should have remembered :). My side, I have found other way which works too, much less efficient to my taste:
private void ListView_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
int idx = e.Position;
ObservableCollection<FlagDetails> fld = GlobalVar.GflagInfo;
Bitmap img = fld[idx].FlagImage;
string str = fld[idx].FlagName;
GlobalVar.GImg = img;
GlobalVar.GTitle = str;
MainActivity.context.StartActivity(typeof(ImageViewerActivity));
}
Thanks for the good help!
Nicolas