有了这个代码的“如果”行断点:为什么这种情况等同于错误?
if ((ckbx.Content != null) && (!ckbx.Content.ToString().Contains("(Empty list)")))
{
string groupName = ckbx.Content.ToString();
var contextMenu = new PopupMenu();
contextMenu.Commands.Add(new UICommand("Edit this Group", contextMenuCmd => Frame.Navigate
(typeof(LocationGroupCreator), groupName)));
contextMenu.Commands.Add(new UICommand("Delete this Group", async (contextMenuCmd) =>
{
await SQLiteUtils.DeleteGroupAsync(groupName);
}));
await contextMenu.ShowAsync(args.GetPosition(this));
}
... ckbx.Content是“(空单)”,但病情被视为假 - 条件失败。为什么?
什么ckbx.Content的类型? – Ameen
它似乎正常工作。第一个条款是真的, “(空列表)”。包含(“空列表”)是真的,但你扔了!在前面,所以它是错误的 –
在这种情况下使用调试器非常有用。 –