I am trying to create some Sample Data from my ViewModel classes in Expression Blend. However Expression Blend stops and says "Object reference not set to an instance of an object". Personally, I don't understand where this exception comes from.
Does anyone have an idea of why this is happening?
This is my UsersListViewModel:
[Export]
public class UserListViewModel : ViewModelBase
{
[ImportingConstructor]
public UserListViewModel(IUserListView view)
: base(view)
{
}
private ObservableCollection<UserItem> _userList;
public ObservableCollection<UserItem> UserList
{
get { return _userList; }
set
{
if (_userList != value)
{
_userList = value;
RaisePropertyChanged("UserList");
}
}
}
private UserItem _selectedUser;
public UserItem SelectedUser
{
get { return _selectedUser; }
set
{
if (_selectedUser != value)
{
_selectedUser = value;
RaisePropertyChanged("SelectedUser");
}
}
}
private string _searchText;
public string SearchText
{
get { return _searchText; }
set
{
if (_searchText != value)
{
_searchText = value;
RaisePropertyChanged("SearchText");
}
}
}
private ICommand _searchCommand;
public ICommand SearchCommand
{
get { return _searchCommand; }
set
{
if (_searchCommand != value)
_searchCommand = value;
}
}
// ... other ICommands
}
Thank you in advance for all your help,
Cheers, G.