Issue
I have a custom binding that accepts entire view model:
public class TextViewGroupInfoBinding : BaseBinding<TextView, GroupViewModel>
{
private IMvxAndroidCurrentTopActivity CurrentTopActivity
{
get { return ServiceLocator.Current.GetInstance<IMvxAndroidCurrentTopActivity>(); }
}
public TextViewGroupInfoBinding(TextView androidControl) : base(androidControl)
{
}
public override MvxBindingMode DefaultMode
{
get { return MvxBindingMode.OneWay; }
}
protected override void SetValueToView(TextView control, GroupViewModel value)
And on UI to bind it the MvxBind="BgColor ."
Syntax is used. How can I rase PropertyChanged
event from my ViewModel
for the binding to react? Tried RaiseAllPropertiesChanged
with no luck.
Solution
Try to add a "Self" property to your ViewModel or View, which returns itself. Then just bind to that Property instead of dot (.) syntax:
public MyViewModel Self
{
get { return this; }
}
Hope this helps
Answered By - Alexey Strakh
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.