Example #1
0
        void ZoomControlMargin_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (Visibility == Visibility.Visible)
            {
                originalZoomLevel = null;
                RegisterEvents();
                UpdateTextWithZoomLevel();

                // The combobox is too tall, but I want to use the style from the UI.Wpf dll
                if (horizontalScrollBarMargin == null)
                {
                    horizontalScrollBarMargin = wpfTextViewHost.GetTextViewMargin(PredefinedMarginNames.HorizontalScrollBar);
                    Debug.Assert(horizontalScrollBarMargin != null);
                    if (horizontalScrollBarMargin != null)
                    {
                        horizontalScrollBarMargin.VisualElement.SizeChanged += VisualElement_SizeChanged;
                    }
                }
                if (horizontalScrollBarMargin != null)
                {
                    Height = horizontalScrollBarMargin.VisualElement.Height;
                }
            }
            else
            {
                UnregisterEvents();
            }
        }
Example #2
0
        private void HideTextViewMargin(IWpfTextViewHost view, string marginName)
        {
            IWpfTextViewMargin margin = view.GetTextViewMargin(marginName) as IWpfTextViewMargin;

            if (margin != null)
            {
//                margin.VisualElement.Width = 0;
                margin.VisualElement.Visibility = System.Windows.Visibility.Collapsed;
            }
        }
        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);
        }
Example #4
0
 public IOverviewTipManager GetOverviewTipManager(IWpfTextViewHost host)
 {
     return(host.GetTextViewMargin(StructureMargin.Name) as IOverviewTipManager);
 }