Created
September 2, 2014 15:23
-
-
Save DVDPT/1408e88d28608455be16 to your computer and use it in GitHub Desktop.
Xamarin really simple binding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
class MonetaryAmount | |
{ | |
double Amount {get;} | |
} | |
class Report | |
{ | |
MonetaryAmount Ecpm {get;} | |
} | |
class DashboardInfo : INotifyPropertyChanged | |
{ | |
Report TodaysReport {get;} | |
} | |
class ReportsController : INotifyPropertyChanged | |
{ | |
DashboardInfo DashboardInfo {get;} | |
} | |
*/ | |
var ecpmText = view.FindViewById<TextView>(Resource.Id.home_ecpm); | |
ViewModel.ReportsController.CreateBindingChain(c => c.DashboardInfo) | |
.CreateBinding(d => d.TodaysReport) | |
.BindTo(ecpmText, t => t.Text, report=>report.Ecpm.Amount.ToString()); | |
ViewModel.ReportsController.CreateBindingChain(c => c.DashboardInfo) | |
.CreateBinding(d => d.TodaysReport) | |
.BindTo(ecpmText, report => report.Ecpm.Amount.ToString()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment