void OnIsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { _context = !IsVisible ? null : KeyMenuContext.Find(this); _items.ItemsSource = _context == null ? null : _context.KeyInfoList; }
static void SetContext(DependencyObject element, KeyMenuContext value) { element.SetValue(ContextProperty, value); }