public Dashboard( DashboardViewModel model, IWpfTextView textView) { _model = model; InitializeComponent(); _tabNavigableChildren = new UIElement[] { this.OverloadsCheckbox, this.CommentsCheckbox, this.StringsCheckbox, this.PreviewChangesCheckbox, this.ApplyButton, this.CloseButton }.ToList(); _textView = textView; this.DataContext = model; this.Visibility = textView.HasAggregateFocus ? Visibility.Visible : Visibility.Collapsed; _textView.GotAggregateFocus += OnTextViewGotAggregateFocus; _textView.LostAggregateFocus += OnTextViewLostAggregateFocus; _textView.VisualElement.SizeChanged += OnElementSizeChanged; this.SizeChanged += OnElementSizeChanged; PresentationSource.AddSourceChangedHandler(this, OnPresentationSourceChanged); try { _findAdornmentLayer = textView.GetAdornmentLayer("FindUIAdornmentLayer"); ((UIElement)_findAdornmentLayer).LayoutUpdated += FindAdornmentCanvas_LayoutUpdated; } catch (ArgumentOutOfRangeException) { // Find UI doesn't exist in ETA. } this.Focus(); textView.Caret.IsHidden = false; ShouldReceiveKeyboardNavigation = false; }
public Dashboard( DashboardViewModel model, IWpfTextView textView) { _model = model; InitializeComponent(); _tabNavigableChildren = new UIElement[] { this.OverloadsCheckbox, this.CommentsCheckbox, this.StringsCheckbox, this.PreviewChangesCheckbox, this.ApplyButton, this.CloseButton }.ToList(); _textView = textView; this.DataContext = model; this.Visibility = textView.HasAggregateFocus ? Visibility.Visible : Visibility.Collapsed; _textView.GotAggregateFocus += OnTextViewGotAggregateFocus; _textView.LostAggregateFocus += OnTextViewLostAggregateFocus; _textView.VisualElement.SizeChanged += OnElementSizeChanged; this.SizeChanged += OnElementSizeChanged; PresentationSource.AddSourceChangedHandler(this, OnPresentationSourceChanged); try { _findAdornmentLayer = textView.GetAdornmentLayer("FindUIAdornmentLayer"); ((UIElement)_findAdornmentLayer).LayoutUpdated += FindAdornmentCanvas_LayoutUpdated; } catch (ArgumentOutOfRangeException) { // Find UI doesn't exist in ETA. } // Once the Dashboard is loaded, the visual tree is completely created and the // UIAutomation system has discovered and connected the AutomationPeer to the tree, // allowing us to raise the AutomationFocusChanged event and have it process correctly. // for us to set up the AutomationPeer this.Loaded += Dashboard_Loaded; this.Focus(); textView.Caret.IsHidden = false; ShouldReceiveKeyboardNavigation = false; }
public Dashboard( DashboardViewModel model, IEditorFormatMapService editorFormatMapService, IWpfTextView textView ) { _model = model; InitializeComponent(); _tabNavigableChildren = new UIElement[] { this.OverloadsCheckbox, this.CommentsCheckbox, this.StringsCheckbox, this.FileRenameCheckbox, this.PreviewChangesCheckbox, this.ApplyButton, this.CloseButton }.ToList(); _textView = textView; this.DataContext = model; this.Visibility = textView.HasAggregateFocus ? Visibility.Visible : Visibility.Collapsed; _textView.GotAggregateFocus += OnTextViewGotAggregateFocus; _textView.LostAggregateFocus += OnTextViewLostAggregateFocus; _textView.VisualElement.SizeChanged += OnElementSizeChanged; this.SizeChanged += OnElementSizeChanged; PresentationSource.AddSourceChangedHandler(this, OnPresentationSourceChanged); try { _findAdornmentLayer = textView.GetAdornmentLayer("FindUIAdornmentLayer"); ((UIElement)_findAdornmentLayer).LayoutUpdated += FindAdornmentCanvas_LayoutUpdated; } catch (ArgumentOutOfRangeException) { // Find UI doesn't exist in ETA. } // Once the Dashboard is loaded, the visual tree is completely created and the // UIAutomation system has discovered and connected the AutomationPeer to the tree, // allowing us to raise the AutomationFocusChanged event and have it process correctly. // for us to set up the AutomationPeer this.Loaded += Dashboard_Loaded; if (editorFormatMapService != null) { _textFormattingMap = editorFormatMapService.GetEditorFormatMap("text"); _textFormattingMap.FormatMappingChanged += UpdateBorderColors; UpdateBorderColors(this, eventArgs: null); } ResolvableConflictBorder.StrokeThickness = RenameFixupTagDefinition.StrokeThickness; ResolvableConflictBorder.StrokeDashArray = new DoubleCollection( RenameFixupTagDefinition.StrokeDashArray ); UnresolvableConflictBorder.StrokeThickness = RenameConflictTagDefinition.StrokeThickness; UnresolvableConflictBorder.StrokeDashArray = new DoubleCollection( RenameConflictTagDefinition.StrokeDashArray ); this.Focus(); textView.Caret.IsHidden = false; ShouldReceiveKeyboardNavigation = false; }