ValueConverters can be a very powerful tool whenever you start working with Xamarin.Forms and XAML. You all probably ran into the situation where you got a weird value from your backend and needed to convert that into something else to show it on screen.
In this video that is exactly what we will see. For the example I will turn a string value into a color by implementing a ValueConverter in XAML. We will also look into ConverterParameters briefly, although that doesn't seem to end very well...
🛑 Don't forget to subscribe to my channel for more cool content: kzitem.info...
🔗 Links
Sample code repo: github.com/jfversluis/XFValue...
Basic Data Binding: • Basic Data Binding in ...
Data Binding Scopes Video: • Xamarin.Forms ListView...
Using Resources in Xamarin.Forms: • Using ResourceDictiona...
Xamarin Forms Repo: github.com/xamarin/Xamarin.Forms
Xamarin.Forms ValueConverters Docs: docs.microsoft.com/xamarin/xa...
⏱ Timestamps
0:00 Intro
0:33 Sample App Outline
1:30 Implement Some UI
2:15 Implement Sample Class
2:39 Free Pro-Tip for Adding Properties!
3:58 Implement More Sample Code (Data-Binding, Don't be Scared!)
7:21 ValueConverter (String to Color) Implementation
8:00 Implement IValueConverter Interface
9:20 Implement Convert Method
11:45 Add ValueConverter to XAML
14:06 Run Sample App
15:00 ConverterParameter with Binding (Doesn't Work! Epic Fail 🤦♂️)
18:03 ConverterParameter with Static Value
18:37 Outro
🎥 Video edited with Camtasia (ref): techsmith.z6rjha.net/AJoeD
🙋♂️ Also find my...
Blog: blog.verslu.is
Twitch: / jfversluis
All the rest: jfversluis.dev
Негізгі бет Тәжірибелік нұсқаулар және стиль Using ValueConverters in Xamarin.Forms XAML, Here Is How To Do It
Пікірлер: 28