Should I have that Gerald seal of approval printed? Maybe I should make a course here and let that be the reward...
@pavelkravchenko28103 жыл бұрын
What about binding in Templates/ DataTemplate, RelativeSource , Source, Reference? There's tons of questions in the internet about it))))
@jfversluis3 жыл бұрын
Maybe this helps: kzbin.info/aero/PLfbOp004UaYWOuVUuEtGlpkDIC1houhn_
@ArielErlijman3 жыл бұрын
Another life saving tip! I´ve just had to put a "Total: " + list.Count in a label and was able to do it with the StringFormat ! awesome. Thx again.
@jfversluis3 жыл бұрын
Woohoo! Perfect! Well done!
@CezarWagenheimer3 жыл бұрын
I didn't know about TargetNullValue and FallbackValue! It's very useful! Thanks for sharing it!
@jfversluis3 жыл бұрын
Ha! My theory still holds! Glad you learned something!
@eekayonline15614 жыл бұрын
Didn't know about the fallbacks so that's one thing I've learned for sure!
@jfversluis4 жыл бұрын
See, theory still holds 😎
@issacproton78854 жыл бұрын
Yes, I knew all of them. By the way, The contents are getting more Impressive as well as very effective to all Xamarin Developers. Thanks a lot for all the contents you're creating. It just Amazing!!!
@jfversluis4 жыл бұрын
Really?! I need to get you that sticker then ;) Thank you for the kind words Issac! I really enjoy doing it. Thanks for all the support!
@issacproton78854 жыл бұрын
@@jfversluis You're doing just great! Everything is getting better.
@argonjs4 жыл бұрын
Appreciate your effort. Keep the good work up.
@jfversluis4 жыл бұрын
Thanks a ton Aruna, I definitely will!
@SayyadHasan3 жыл бұрын
Excellent, truly I was not aware of TargetNullValue and FallbackValue
@jfversluis3 жыл бұрын
Glad you learned something!
@JasonPurkiss4 жыл бұрын
thanks for a great video, would you know how i would go about implementing phpickerviewcontroller in IOS 14 to access photos or should i just wait for James montemagno to update his media plugin? im quite disappointed in my self that i just dont know where to start :(
@jfversluis4 жыл бұрын
Thank you Jason! First of all: don't be disappointed! This stuff is hard to figure out, so don't feel bad. Second; I guess it's all about the investment you want to make vs how bad you need it. If you can wait for someone to implement it, then that is the easy route. If you need it/want it sooner or with more guarantees that you will even actually get it, start rolling your own. You could look at how the Media Plugin does the picking today. If you're reaaaaally lucky, just rename everything to PHPickerViewController and you're done, probably a little bit more work than that, if you're not so lucky it will be a can or works and you need to reimplement the whole thing. Having all that said; I think the Media Plugin bits are slowly rolled into Essentials, so I wouldn't expect any big updates on the Media Plugin anymore, rather look at Essentials. I see they already have an open issue for this here: github.com/xamarin/Essentials/issues/1402 the milestone says 1.6, so it might be in there soon...? Hope this helps you a tiny bit :)
@iancarroll39183 жыл бұрын
Great work. Is it possible to have the number format bound to a property?
@jfversluis3 жыл бұрын
You mean like this? docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/data-binding/string-formatting
@derrickwright17014 жыл бұрын
Thanks for the video! Ive been struggling to data-bind for a few days now and your video helped a bit. Does this also work with listviews or how would you approach binding to an object property for a listview? Thanks
@jfversluis4 жыл бұрын
Glad to read it helped! I already replied to your other comment, let me know how I can help you. Else let's jump on email or something for some better communication :)
@raffimansoor37394 жыл бұрын
Hi @Gerald ..awesome video...can you please make a video about Xamarin Forms 5.0
@jfversluis4 жыл бұрын
Absolutely! Just see what is new with a little demo? Did you also see this episode of the Xamarin Show covering this? kzbin.info/www/bejne/qqWpaWOLo9d9d8k
@raffimansoor37394 жыл бұрын
@@jfversluis Thanks a lot ..This is awesome ..😀
@poorneshv75323 жыл бұрын
Hey Gerald Thank you very much for your content. Can you do videos on UI Animations? We don't have much content on it online .
@jfversluis3 жыл бұрын
Unfortunately I’m not the best at that myself 😅 you might want to keep you eye on this blog: blog.bijington.com
@jxndwl4 жыл бұрын
Useful tips, thanks. I really rely on XAML designer in WPF to setting up binding expression(the little yellow rectangle), remember all the gramma for databinding is very hard for me, especially for serial of RelativeSource. Hope one day Xamarin forms team make XAML designer to have the GUI way to setting DataBinding.
@jfversluis4 жыл бұрын
Thank you so much! We can always hope, but I don't think a XAML designer is something that will come :( If there is anything I can do for you, don't hesitate to reach out!
@vijaichaudhary80923 жыл бұрын
Thanks you..Learn all of them
@jfversluis3 жыл бұрын
Great Vijai! Thank you for watching!
@heinzd55232 жыл бұрын
Is there a way for one Content Page to bind to two ViewModel pages? ie: have two Bindingcontext statements in the code behind/
@jfversluis2 жыл бұрын
No and tbh I don’t think that’s something you should want. Each element on the page can have its own BindingContext so you might be able to do something with that, but again; I don’t think you’ll have a fun time maintaining that
@Swarajcookingnfun2 жыл бұрын
Hey Gerald!! How we can implement required field validation in entry box?
@jfversluis2 жыл бұрын
You probably want to check this out: kzbin.info/www/bejne/qIPRY55poZWDbs0
@umermahmood63664 жыл бұрын
Please make a video on use case when our page has two or three different sections (stack layouts or grids), Each section is binded to a specific property. Where each property basically represents an object with multiple fields. Or just to begin with, two stack layouts, binded to two different properties, where each property has some string, some number, some double. Thank you.
@jfversluis3 жыл бұрын
I think the thing you're describing is possible, but why not create a view model that has the properties that you need? That is what view models are for, to not have many different objects providing all the properties. Then from the view model you should propagate the values to the right models and continue processing from there. Hope I understood you correctly :)
@AMIRKHAN-dm2fm4 жыл бұрын
Thanks but tell me one thing if I don't have iOS or mac device then how i can test my xamarin.iOs application?
@jfversluis4 жыл бұрын
If you don't have a Mac or iOS device it's going to be hard. You can look into renting a Mac with a solution like www.macincloud.com/ if you have just an iOS device you should look into Hot Reload which allows you to debug with a Mac but just an iOS device and a developer account. Unfortunately, Apple does not allow to run macOS and therefore Xcode and the Simulator to run on anything but their own hardware
@AMIRKHAN-dm2fm4 жыл бұрын
@@jfversluis Ok Thank you so much
@jfversluis4 жыл бұрын
@@AMIRKHAN-dm2fm No problem!
@rajeshjha36814 жыл бұрын
Nice video on Data Binding.
@jfversluis4 жыл бұрын
Thank you for joining me again Rajesh!
@adamdiment83854 жыл бұрын
Thanks Gerald, I enjoyed this video. I knew them all except the difference between targetnullvalue and fallback value I think :-) Oh wait, and that Binding X is shorthand for Binding Path=X.... who knew! So you can teach an old dog new tricks... A couple of things I would like to hear about in follow up vids 1) Using the Source property of binding 2) More complex stringformat bindings including multiple properties 3) The pros and cons of compiled bindings vs runtime bindings. Thanks!
@jfversluis4 жыл бұрын
Ha! It's funny how these things that you take for granted still hold some secrets, right?! Glad you found it helpful! Those are amazing ideas for follow-ups, thank you so much for the suggestions, I have put them on the list and will definitely work on that. Do you have anything specific in mind for number 1? Are you looking for use-cases? Or how to actually implement it?
@jfversluis4 жыл бұрын
Actually, have a look at this video: kzbin.info/www/bejne/haPCoqFunp2djK8 this talks about the scope :)
@adamdiment83854 жыл бұрын
@@jfversluis Thanks Gerald. Re number 1 - both I guess. I've used x:Reference bindings on my custom content views to set the context of the view elements to the content view itself, and then bind to my custom properties. But haven't ever really delved any further into what more can be accomplished with "Source". I wonder if I'm missing some tricks to simplify my xaml that you might know. Some questions that come to mind... a) Reading through the docs I think that the "Source" IS the binding context right? So what would be the difference between setting "BindingContext" on a view, vs setting Source within a {Binding Path=..., Source=...}? Are they equivalent? Is there a time to use one or the other? For instance, after hacking around a bit this morning with some very bad xaml, (xaml screenshot: gyazo.com/85a29a404a57210d5648ffad0d8589a1 result: gyazo.com/476aed93d1128616c3622e8231650132) it seems that setting the source manually for a single property of a parent element might be a good way to break out of the binding context for a parent view, without affecting the binding context of subviews of that parent. Whereas setting the "BindingContext" on a parent view, would also set the context for all subviews. Is this right? And are there other factors to consider / benefits to gain from one approach or the other? b) Can x:Reference / manually setting the Source property have benefits / uses in an MVVM app? The docs seem to focus on use cases where the code behind is the binding context. E.g. Sliders controlling label rotation etc. Interesting but not super practical for MVVM. Thanks! I'm enjoying the null pointers podcast too btw.
@jfversluis4 жыл бұрын
@@adamdiment8385 Thank you so much Adam! Did you also see my previous reply with the link to a video where I talk about the Source? Here it is again: kzbin.info/www/bejne/haPCoqFunp2djK8 a) you're absolutely right, you are effectively setting the BindingContext with this b) I think the biggest scenario for this would be whenever you are in an ItemTemplate and want to set the Source to your ViewModel rather than the item in your collection. One example for that would be where you have a swipe action on an item in your collection. I.e. to delete it. You probably want to set the Source to reference the BindingContext of your ViewModel which has a delete Command, rather than implementing the delete Command on the item in your collection. Does that make sense? :)
@marthinch4 жыл бұрын
I have a question, can we create generic page by using xaml in xamarin form? I've tried to create a generic page but I use c# behind code to create the page and I just want to know if there's a way to create generic page by using xaml in xamarin form.
@jfversluis4 жыл бұрын
Thanks for your question Marthin! What do you mean exactly by generic page? Maybe it's easier to discuss if you send me an email :) please find my address on github.com/jfversluis and we will discuss there.
@guywangueu98173 жыл бұрын
So good you are the best
@jfversluis3 жыл бұрын
Thanks so much! 🤗
@andreybundin61023 жыл бұрын
How to bind Content.TranslationX of gesture container in XAML?
@jfversluis3 жыл бұрын
It's just another bindable property so it shouldn't be any different than any other property you are data binding to. Do you have issues with it?
@andreybundin61023 жыл бұрын
@@jfversluis yes, I have. "TranslationX" is bindable property and it is able to bind, but "Content.TranslationX" is different and it not do. Content.TranslationX is attached property of gesture container, through it you do not aproach to the container, but to his children, as i think. I spend almost half year for this issue, but do not have answer yet. It is not importent if you do not use MVVM, beacuse you may call for this property in code behinde as "name of container".Content.TranslationX. I only have some not very good result: made the container static in auto assambler and then i can approach to container in VM like in code behind
@jfversluis3 жыл бұрын
@@andreybundin6102 Ah yeah I think with attached properties it doesn't work out of the box. So if you made something that works, although not that nice, stick with it for now :D
@andreybundin61023 жыл бұрын
@@jfversluis maybe there is some way change the "box", maybe through CLR or by use nuget? And can i make example static in XAML?
@andreybundin61023 жыл бұрын
@@jfversluis my way is bad, becuse every chang in XAML recompile assambler (sorry, maybe i call it not correct) and i must writ static in it again :)
@matt-i3r6w3 жыл бұрын
How can I bind a value that uses Preferences.Get?
@jfversluis3 жыл бұрын
Easiest is to create a property that just returns that value :)
@jayveebelano90412 жыл бұрын
interesting vid very informative
@jfversluis2 жыл бұрын
Thank you!
@GV_Frames2 жыл бұрын
good useful to me
@jfversluis2 жыл бұрын
Great! Thanks for letting me know!
@Mafyou752 жыл бұрын
I prefere setting my databinding context in Xaml. With that, you got intellisense !
@jfversluis2 жыл бұрын
Absolutely true! Luckily we have options and each can use their own preferred way :)
@Mafyou752 жыл бұрын
Then, why turn off intellisense?
@Elsa-jw3xe4 жыл бұрын
Love the video, good work. Unfortunately i did not know it all, so no sticker for me bleeeh :S
@jfversluis4 жыл бұрын
Haha o no! Well, not a sticker, but you did win in knowledge! :D There will be other chances where I'm sure you will get one! Thanks for watching!