콘텐츠로 이동

MenuItem.CanClick property

이 콘텐츠는 아직 번역되지 않았습니다.

Asked whether the row can be clicked, for a row whose condition is local enough that a command would be ceremony. Combined with IsEnabled and with the command’s own answer rather than replacing either, so any of the three disables the row.

public Func<bool>? CanClick { get; set; }

A predicate carries no change signal. It is asked again each time the menu opens, which is the only moment a row is about to be read; a condition that changes while the menu is up must be expressed as a binding to IsEnabled instead.