Exemplo n.º 1
0
        private void lbAutoComplete_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
        {
            if (lbAutoComplete.SelectedItem != null)
            {
                var entry = (Entry)lbAutoComplete.SelectedItem;
                var menu =  new System.Windows.Controls.ContextMenu();
                var mi1 = new System.Windows.Controls.MenuItem();
                mi1.Header = "Open Folder";
                mi1.Click += (x, y) =>
                {
                    Process.Start(System.IO.Path.GetDirectoryName(entry.Command));
                };

                var mi2 = new System.Windows.Controls.MenuItem();
                mi2.Header = "Edit";
                mi2.Click += (x, y) =>
                {
                    var edit = new EditEntry(entry);
                    edit.ShowDialog();
                };

                menu.Items.Add(mi1);
                menu.Items.Add(mi2);

                menu.PlacementTarget = lbAutoComplete;
                menu.IsOpen = true;
            }
        }
Exemplo n.º 2
0
 private void btnEdit_Click_1(object sender, RoutedEventArgs e)
 {
     EditEntry edit = new EditEntry((Entry)lbEntries.SelectedItem);
     edit.ShowDialog();
 }