mirror of
https://github.com/vczh-libraries/Release.git
synced 2026-05-21 04:31:33 +08:00
Use BindableListView.NotifyItemDataModified in tutorial to improve performance
This commit is contained in:
@@ -122,12 +122,6 @@ public:
|
||||
birthday = _birthday;
|
||||
phone = _phone;
|
||||
address = _address;
|
||||
|
||||
vint index = category->contacts.IndexOf(this);
|
||||
if (index != -1)
|
||||
{
|
||||
category->contacts.NotifyUpdate(index, 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -160,6 +160,11 @@
|
||||
window.MoveToScreenCenter();
|
||||
window.SetContact(ViewModel.SelectedContact);
|
||||
$Await window.ShowModalAsync(self);
|
||||
|
||||
if (window.Ready)
|
||||
{
|
||||
listViewContacts.NotifyItemDataModified(listViewContacts.SelectedItemIndex, 1);
|
||||
}
|
||||
delete window;
|
||||
}
|
||||
]]>
|
||||
|
||||
@@ -1378,6 +1378,10 @@ Closures
|
||||
throw ::vl::Exception(::vl::__vwsn::This(::vl::__vwsn::This(__vwsn_co_result_.Obj())->GetFailure().Obj())->GetMessage());
|
||||
}
|
||||
}
|
||||
if (::vl::__vwsn::This(__vwsn_co0_window)->Ready)
|
||||
{
|
||||
::vl::__vwsn::This(__vwsnthis_0->listViewContacts)->NotifyItemDataModified(::vl::__vwsn::This(__vwsnthis_0->listViewContacts)->GetSelectedItemIndex(), static_cast<::vl::vint>(1));
|
||||
}
|
||||
::vl::__vwsn::This(__vwsn_co0_window)->Dispose(true);
|
||||
this->SetStatus(::vl::reflection::description::CoroutineStatus::Stopped);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user