No video

Build Your Own Custom Value Converter For WPF Binding

  Рет қаралды 192

Dev Leader

Dev Leader

Күн бұрын

What happens when the built-in value converters in WPF just aren't cutting it for you anymore?
That's right. You need to take matters into your own hands.
In this video tutorial, I'll show you how to make your own custom value converters using IValueConverter. Create more flexible bindings! Now you can map between different types of data on your control and your view model.
----
🔑 Membership & Subscriptions:
- 📨 Weekly Newsletter: weekly.devleader.ca
- 🏘️ Private Discord Community: / discord
- 📽️ KZfaq Membership: / @devleader
🧠 Courses:
- All Courses: www.devleader.ca/courses
- Getting Started with C#: dometrain.com/course/getting-...
- Deep dive C#: dometrain.com/course/deep-div...
- C# Zero to Hero BUNDLE: dometrain.com/bundle/from-zer...
- Refactoring For C# Devs: dometrain.com/course/from-zer...
- [FREE] Intro to Software Development: • [FREE MINI COURSE] - I...
🗣️ Social Media & Links:
- All My Links: linktr.ee/devleader
- Blog: www.devleader.ca/
- TikTok: / devleader
- LinkedIn: / nickcosentino
- Threads: threads.net/@dev.leader
- Twitter: / devleaderca
- Facebook: / devleaderca
- Instagram: / dev.leader
- GitHub: github.com/ncosentino/
- Twitch: / devleaderca
- KZfaq: / @devleader
❤️ Affiliations & Products/Services That I Love:
- VPS hosting from RackNerd: my.racknerd.com/aff.php?aff=9013
- VPS hosting from Contabo: www.jdoqocy.com/click-1010286...
- My newsletter platform ConverKit: convertkit.com/?lmref=c5X7KQ
- My newsletter referral system SparkLoop: dash.sparkloop.app/signup?aff...
- My AI shorts helper Opus Clip: opus.pro/?via=2f9e97
- I try to help answer questions at Quora: www.quora.com/quoraplus?ch=10...
- My favorite computer parts store Newegg: click.linksynergy.com/fs-bin/...
- My favorite supplement store Bulk Supplements: glnk.io/63qn/devleader
----
#dotnet #csharp #wpf #frontend

Пікірлер: 5
@DevLeader
@DevLeader Ай бұрын
💡 Learn how to program in C#: - dometrain.com/course/getting-started-csharp?affcode=1115529_nl-teyzg 🧠Deep dive on C#: - dometrain.com/course/deep-dive-csharp?affcode=1115529_nl-teyzg 🎁Zero to Hero C# Bundle: - dometrain.com/bundle/from-zero-to-hero-csharp/?affcode=1115529_nl-teyzg 💪 Skill up your refactoring: - dometrain.com/course/from-zero-to-hero-refactoring-for-csharp-developers?affcode=1115529_nl-teyzg ✉ Subscribe to my free software engineering newsletter: - subscribe.devleader.ca
@krccmsitp2884
@krccmsitp2884 Ай бұрын
At some point I stopped writing custom ValueConverters. Instead, the ViewModels themselves provided properties with the target type to bind to.
@DevLeader
@DevLeader Ай бұрын
@@krccmsitp2884 spoiler alert for upcoming videos: that's exactly where my career led me to as well 😁 The concept was interesting but value converters simply never delivered long-term for us
@r14958
@r14958 Ай бұрын
@@DevLeader Doesn't this mean that the ViewModel must be very "View aware", which sounds like a MVVM no-no?
@DevLeader
@DevLeader Ай бұрын
​@@r14958there's a lot about mvvm I'm not a huge fan of, but the view models never know about the views ever. I just have view models that can do a transform into WPF-centric things without a converter. For example, I'd have a visibility property directly on the view model and not only an IsVisible. I just cut out the value converter middleman -- and no reference to the view. If the problem becomes "well it shouldn't need to know if it's actually Visibility or not", then in these situations I've used two tiers of view models to separate these concepts into different classes. In this case if you change your view implementation you still have a "buffer" through one more layer of abstraction.
ОБЯЗАТЕЛЬНО СОВЕРШАЙТЕ ДОБРО!❤❤❤
00:45
Это реально работает?!
00:33
БРУНО
Рет қаралды 4,2 МЛН
لااا! هذه البرتقالة مزعجة جدًا #قصير
00:15
One More Arabic
Рет қаралды 50 МЛН
Caixa de Texto com Animção de Gotas Utilizando SVG | CSS & JS
8:55
The Purple Fox Design
Рет қаралды 2
AVOID THESE! - Follow The Quartz NET Listener Best Practices
12:37
Hello, old friend…
13:34
Linus Tech Tips
Рет қаралды 1 МЛН
Screw It, iPhone Air
8:49
TechLinked
Рет қаралды 229 М.