MainPageVM : INotifyPropertyChanged
{
#region Properties
ObservableCollection<WifiNetworkDto> _WifiNetworks;
public ObservableCollection<WifiNetworkDto> WifiNetworks
{
get
{
return _WifiNetworks;
}
set
{
_WifiNetworks = value;
SetProperty(ref _WifiNetworks, value, "WifiNetworks");
}
}
WifiNetworkDto _selectedNetwork;
public WifiNetworkDto SelectedNetwork
{
get
{
return _selectedNetwork;
}
set
{
_selectedNetwork = value;
SetProperty(ref _selectedNetwork, value, "SelectedNetwork");
}
}
bool isBusy;
public bool IsBusy
{
get { return isBusy; }
set
{
if (isBusy == value)
return;
isBusy = value;
OnPropertyChanged("IsBusy");
}
}
bool isConnected;
public bool IsConnected
{
get { return isConnected; }
set
{
if (isConnected == value)
return;
isConnected = value;
OnPropertyChanged("IsConnected");
}
}
#endregion
public event PropertyChangedEventHandler PropertyChanged;
public MainPageVM() {
}
protected bool SetProperty<T>(ref T backingStore, T value,
[CallerMemberName]string propertyName = "",
Action onChanged = null)
{
if (EqualityComparer<T>.Default.Equals(backingStore, value))
return false;
backingStore = value;
onChanged?.Invoke();
OnPropertyChanged(propertyName);
return true;
}
public void OnPropertyChanged([CallerMemberName]string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}
у вас в XAML написано WiFiNetworks, а в VM WifiNetworks
лучше на gist / pastebin / etc большие куски кода выкладывать
Обсуждают сегодня