예제 #1
0
        public void BtnAddEdit_Click(object sender, RoutedEventArgs e)
        {
            AddEditView addEditView = new AddEditView(null, this);

            this.btnAddEdit.IsEnabled = false;
            this._notifyIcon.ContextMenu.MenuItems["Add new word"].Enabled = false;
            addEditView.Closed += AddEditView_Closed;
            addEditView.Show();
        }
예제 #2
0
        private ContextMenu FormatContextMenu()
        {
            ContextMenu contextMenu = new ContextMenu();
            MenuItem    item        = new MenuItem();

            item.Header = "Show next word";
            item.Click += (s, e) => { GetRandomKanji(); };
            contextMenu.Items.Add(item);

            item        = new MenuItem();
            item.Header = "Edit";
            item.Click += (s, e) => {
                AddEditView addEditView = new AddEditView(_myKanji, this);
                addEditView.Closed += (s1, e1) => { _isEditFormShow = false; };
                _isEditFormShow     = true;
                addEditView.Show();
            };
            contextMenu.Items.Add(item);

            return(contextMenu);
        }