internal EditorDiffMargin(IWpfTextView textView, IMarginCore marginCore) : base(textView) { ViewModel = new EditorDiffMarginViewModel(marginCore, UpdateDiffDimensions); UserControl = new EditorDiffMarginControl {DataContext = ViewModel, Width = MarginWidth}; }
private void ShowPopUp(EditorDiffMarginViewModel diffMarginViewModel) { _diffMarginViewModel = diffMarginViewModel; ShowPopup = true; }
private bool TryGetMarginViewModel(out EditorDiffMarginViewModel viewModel) { viewModel = null; IWpfTextViewHost textViewHost = _editorAdaptersFactoryService.GetWpfTextViewHost(TextViewAdapter); if (textViewHost == null) return false; EditorDiffMargin margin = textViewHost.GetTextViewMargin(EditorDiffMargin.MarginNameConst) as EditorDiffMargin; if (margin == null) return false; viewModel = margin.VisualElement.DataContext as EditorDiffMarginViewModel; return viewModel != null; }