public class MoznostSerazeni : INotifyPropertyChanged { private string text; private bool serazeno = false; public string Text { get { return text; } set { text = value; } } public bool Serazeno { get { return serazeno; } set { serazeno = value; OnPropertyChanged("Poradi"); } } public event PropertyChangedEventHandler PropertyChanged; public void OnPropertyChanged(string name) { if (this.PropertyChanged != null) { this.PropertyChanged(this, new PropertyChangedEventArgs(name)); } } }
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}
private void Button_Clicked(object sender, EventArgs e)
{
var BC = viewModel.ContactsInfo;
for(int i=0;i<BC.Count-1;i++)
{
if (i % 3 == 0)
BC[i].NewContactNumber = "11111";
}
viewModel.ContactsInfo = new ObservableCollection<Contacts>(BC.OrderBy(i => i.NewContactNumber));
}
}
|
public ObservableCollection<Item> Items
{
get
{
return items;
}
set
{
items = value;
//Parameter should be the same as PropertyName. i.e., Items
this.RaisedOnPropertyChanged("Items");
}
} |