Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

DataBinding for Renderer

$
0
0

Hi,

I have a ViewModel with some properties and want to use them in a custom renderer page.
As far as I've seen, there is no "direct" way to to this. So I should bind my Page to the ViewModel and greate properties in my page, to use them in my custom renderer.

But in this case, I dont use any View elements to use the SetBinding method.
Actually I want to bind properties to each other.

My ViewModel
DemoViewModel.cs

 public string Mode
         {
             get { return _mode; }
             set { SetProperty(ref _mode, value); }
         }

And in my Page Class I use
BindingContext = new DemoViewModel();
in the constructur.

Now i need to create a new propertie in that class to use this in my custom renderer

But how can I do this to get the right value from my ViewModel? In the get or set method, I cant use setBinding or something like that.
Or at least, I can't find a way how to do. I have to do this without xaml, because none of those prop. will be used to display anything.

thanks


Viewing all articles
Browse latest Browse all 204402

Trending Articles



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