i trying implement bread crumb navigation. have string array in c# code this:
public static readonly bindableproperty currentpathproperty = bindableproperty.create<filebrowser, string[]>(c => c.currentpath, null); public string[] currentpath { { return getvalue(currentpathproperty) string[]; } set { setvalue(currentpathproperty, value); } } what correct way bind property in xaml (display bread crumbs , update currentpath when 1 of them tapped)? i've tried googling listviews , x:array don't see straightforward way this. know need propertychanged event handler it's not clear me needs happen on xaml side or handler like.
if want control update when items added array, should use implementing inotifycollectionchanged, observablecollection instead of array.
with source, can bind itemsource of listview; listview being xamarin.forms controls supports datatemplating out of box.
anything more complex require defining own control, inheriting e.g. stacklayout or other layout, , handle creating label each of string added array.
Comments
Post a Comment