I have fiddled around with MVVM lately in C# and i got to the point where i thought i understood how bindings work but then this happened...
using System;
using System.Collections.Generic;
using System.Text;
namespace API
{
public class ApiViewModel : BaseViewModel
{
public bool CustomerIsChecked { get; set; }
public bool StorageIsChecked { get; set; }
public bool ArticlesIsChecked { get; set; }
public bool Transfer()
{
if(CustomerIsChecked == true)
{
return true;
}
return false;
}
public override string ToString()
{
return Transfer().ToString();
}
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Text;
using PropertyChanged;
namespace API
{
[AddINotifyPropertyChangedInterface]
public class BaseViewModel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged = (sender, e) => { };
}
}
This works if i just like send in a string or anything to the binding directly but when i try to send in the value of transfer it does not work it gives me an empty button why is this? My question is why this doesnt work quz basicly when you are using a string without any parameters or anything and just do a getter or setter it works but to send in a string that has this doesnt? Why is this?