public RenameFlyout(RenameFlyoutViewModel viewModel, ITextView textView) { DataContext = _viewModel = viewModel; _textView = textView; _textView.LayoutChanged += TextView_LayoutChanged; _textView.ViewportHeightChanged += TextView_ViewPortChanged; _textView.ViewportWidthChanged += TextView_ViewPortChanged; _textView.LostAggregateFocus += TextView_LostFocus; _textView.Caret.PositionChanged += TextView_CursorChanged; // On load focus the first tab target Loaded += (s, e) => { Focus(); MoveFocus(new TraversalRequest(FocusNavigationDirection.First)); }; InitializeComponent(); PositionAdornment(); }
public RenameFlyout(RenameFlyoutViewModel viewModel, ITextView textView) { DataContext = _viewModel = viewModel; _textView = textView; _textView.LayoutChanged += TextView_LayoutChanged; _textView.ViewportHeightChanged += TextView_ViewPortChanged; _textView.ViewportWidthChanged += TextView_ViewPortChanged; _textView.LostAggregateFocus += TextView_LostFocus; _textView.Caret.PositionChanged += TextView_CursorChanged; // On load focus the first tab target Loaded += (s, e) => { IdentifierTextBox.Focus(); IdentifierTextBox.Select(_viewModel.StartingSelection.Start, _viewModel.StartingSelection.Length); }; InitializeComponent(); PositionAdornment(); }