Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

How to handle bindings when nesting views?

$
0
0

I find myself often wrapping a Label in a ContentView. I do this so often that I have created a class (let's call it PaddedLabel) that inherits from ContentView and that contains a member of type Label. So far, so good.

My question is, when the code that makes use of this new class PaddedLabel uses a binding to set the BackgroundColor, I want PaddedLabel to set the BackgroundColor of both the ContentView and the Label. How is this best implemented?


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>