private SimpleTagButton createTagButton(SimpleTagButtonModel tag)
        {
            SimpleTagButton btn = new SimpleTagButton()
            {
                DataContext = tag,
                Margin      = new Thickness(0, 5, 5, 0)
            };

            btn.Click += TagButton_Click;
            return(btn);
        }
Пример #2
0
 private void RemovePageTagButton_Click(object sender, RoutedEventArgs e)
 {
     if (_model != null)
     {
         tagInput.FocusInput();
         SimpleTagButton tagBtn = e.OriginalSource as SimpleTagButton;
         if (tagBtn != null)
         {
             SimpleTagButtonModel mdl = tagBtn.DataContext as SimpleTagButtonModel;
             if (mdl != null)
             {
                 _model.PageTags.RemoveAll(new string[] { mdl.TagName });
             }
         }
     }
 }