Xamarin的Telerik ListView中当前刷工的重新涂料
为了使最小的可重现样本我创建了一个绑定的记录
类,当该项目被刷时,它显示了[$]
按钮。点击按钮成功关闭滑动并使用此代码更新列表项目:
public ICommand ClickCommand { get; }
private void OnClick(Record record) => onToggle(record);
bool _toggled = false;
private void onToggle(Record record)
{
_toggled = !_toggled;
if(_toggled)
{
Title = "Toggled";
BackgroundColor = Color.LightSalmon;
}
else
{
Title = "Normal";
BackgroundColor = Color.Transparent;
}
ListView.EndItemSwipe();
}
所以绑定还可以,但是我真正想做的是将项目留在滑动状态,并在卡上立即使用背景颜色 。评论\\ ListView.EndItemSwipe();
使滑动保持活跃。点击[$]
重新粉刷按钮本身,但是卡不会重新绘制 通过敲击卡片关闭刷卡:
问题是如何在项目卡仍然被刷时将刷新刷新,即在第4帧的第三帧中。 (我有很多想要这样做的原因,此示例只是演示了基本的核心问题。)
To make a Minimal Reproducible Sample I have created a bound Record
class and when this item is swiped it reveals the [$]
button. Tapping the button successfully closes the swipe and updates the list item using this code:
public ICommand ClickCommand { get; }
private void OnClick(Record record) => onToggle(record);
bool _toggled = false;
private void onToggle(Record record)
{
_toggled = !_toggled;
if(_toggled)
{
Title = "Toggled";
BackgroundColor = Color.LightSalmon;
}
else
{
Title = "Normal";
BackgroundColor = Color.Transparent;
}
ListView.EndItemSwipe();
}
So the bindings are OK but what I really want to do is leave the item in the Swiped state and have the background color applied immediately to the card. Commenting out the \\ ListView.EndItemSwipe();
makes the swipe stay active. Tapping the [$]
repaints the button itself but the card doesn't redraw until the swipe is closed by tapping the card:
So my question is how to force a refresh on the item card while it's still swiped, i.e. during the 3rd frame above not the 4th. (I've got lots of reasons for wanting to do this and this example simply demonstrates the basic core issue.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论