dotnet / MobileBlazorBindings

Experimental Mobile Blazor Bindings - Build native and hybrid mobile apps with Blazor
MIT License
1.2k stars 151 forks source link

how can I use AttributeValue for Xamarin.forms.Map.Pins #394

Open SuperRealTeam opened 3 years ago

SuperRealTeam commented 3 years ago

Hello

I hope you are doing well , I know that your very busy these days ,but really I need your help in how can I use AttributeValue for Xamarin.forms.Map.Pins and Pins here is List when I use paramter with List it give me specified cast not vaild like in the attached Image. Screenshot_1627173962

SuperRealTeam commented 3 years ago

I Try To use some Hacks Like serliaze the List to Json then in ViewHandler I deserilaze it and it really done the job until We get Best Solution form your side.

Dreamescaper commented 3 years ago

Usually it involves wrapping the object in delegate using AttributeValueHolderFactory (and unwrapping it in Handler).

SuperRealTeam commented 3 years ago

Yes, that's the idea ,so I think jsonize any Generic like list or Ienuramble to be string then de serilasize it from string to Generic is it the good wrapper or do u think it have another best wrapper for it.

Dreamescaper commented 3 years ago

You simply use AttributeHelper.ObjectToDelegate (which uses AttributeValueHolderFactory underneath) in component, and AttributeHelper.DelegateToObject<List<Xamarin.Forms.Map.Pin>> in handler. No need to serialize those. See examples below (from InputView).

Component example Handler example

SuperRealTeam commented 3 years ago

Yes that's Great thanks so much