-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathViewModel.cs
56 lines (48 loc) · 1.6 KB
/
ViewModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
using Syncfusion.Windows.Shared;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
namespace DragandDropDemo
{
public class UserInfoViewModel : INotifyPropertyChanged, IDisposable
{
/// <summary>
/// Initializes a new instance of the <see cref="ViewModel"/> class.
/// </summary>
public UserInfoViewModel()
{
UserDetails = new UserInfoRepository().GetUserDetails(120);
UserDetails1 = new UserInfoRepository().GetUserDetails1(120);
}
private ObservableCollection<UserInfo> userDetails;
public ObservableCollection<UserInfo> UserDetails
{
get { return userDetails; }
set { userDetails = value; RaisePropertyChanged("UserDetails"); }
}
public void Dispose()
{
if (UserDetails != null)
UserDetails.Clear();
}
private ObservableCollection<UserInfo> userDetails1;
public ObservableCollection<UserInfo> UserDetails1
{
get { return userDetails1; }
set { userDetails1 = value; RaisePropertyChanged("UserDetails1"); }
}
public event PropertyChangedEventHandler PropertyChanged;
public void RaisePropertyChanged(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyname));
}
}
}
}