Exemplo n.º 1
0
 public RenameDialog(string path)
 {
     InitializeComponent();
     DataContext             = new RenameDialogViewModel(path);
     RenameTextBox.Focusable = true;
     RenameTextBox.Focus();
 }
Exemplo n.º 2
0
        private void RenameButton_Click(object sender, RoutedEventArgs e)
        {
            int selectedIndex = ManagePMListBox.SelectedIndex;

            if (selectedIndex > -1)
            {
                RenamePanel.Visibility = System.Windows.Visibility.Visible;
                RenameTextBox.Focus();
            }
        }
Exemplo n.º 3
0
        public RenameView()
        {
            InitializeComponent();

            Loaded += (o, e) =>
            {
                RenameTextBox.Focus();
                RenameTextBox.SelectAll();
            };
        }
Exemplo n.º 4
0
        private void BeginRename(ExplorerObjectListViewItem item)
        {
            if (item == null || !(item.ExplorerObject is IExplorerObjectRenamable))
            {
                return;
            }

            RenameTextBox box = new RenameTextBox(item.ExplorerObject as IExplorerObjectRenamable);

            box.Bounds = new Rectangle(16, item.Bounds.Y, item.Bounds.Width - 16, item.Bounds.Height);
            box.Text   = item.Text;

            listView.Controls.Add(box);
            box.Visible = true;

            box.Focus();
            box.Select(0, item.Text.Length);
        }
Exemplo n.º 5
0
        private void RenamePopup_Opened(object sender, EventArgs e)
        {
            SetTextboxContentAndSize();
            _targetItem = ViewModel.Workspace.ActiveLister.View.ListView.SelectedItem as IItem;
            if (_targetItem is IRenameable renameable)
            {
                _cancelRename = false;
                _renameable   = renameable;
                var selectionBorders = _renameable.GetRenameSelectonBorder();
                RenameTextBox.SelectionStart  = selectionBorders.Item1;
                RenameTextBox.SelectionLength = selectionBorders.Item2;
            }
            else
            {
                return;
            }

            RenameTextBox.Focus();
        }
Exemplo n.º 6
0
 private void CustomDialogLoaded(object sender, RoutedEventArgs e)
 {
     RenameTextBox.SelectAll();
     RenameTextBox.Focus();
 }
Exemplo n.º 7
0
 private void AfterLoadHandler(object sender, RoutedEventArgs e)
 {
     RenameTextBox.Focus();
     RenameTextBox.SelectAll();
     Loaded -= AfterLoadHandler;
 }