Esempio n. 1
0
        protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
        {
            _editor = this.FindControl <Standard.CodeEditor.CodeEditor>("editor");

            _editor.RequestTooltipContent += _editor_RequestTooltipContent;

            shell = IoC.Get <IShell>();

            _editor.GetObservable(AvalonStudio.Controls.Standard.CodeEditor.CodeEditor.IsDirtyProperty).Subscribe(dirty =>
            {
                if (dirty && DataContext is EditorViewModel editorVm)
                {
                    editorVm.Dock = Dock.Left;

                    // Selecting the document event though it already is, causes it to be removed from the temporary document cache.
                    editorVm.IsTemporary   = false;
                    shell.SelectedDocument = editorVm;
                }
            });
        }
Esempio n. 2
0
        protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
        {
            _editor = this.FindControl <Standard.CodeEditor.CodeEditor>("editor");

            _editor.RequestTooltipContent += _editor_RequestTooltipContent;

            shell = IoC.Get <IShell>();

            _editor.GetObservable(AvalonStudio.Controls.Standard.CodeEditor.CodeEditor.IsDirtyProperty).Subscribe(dirty =>
            {
                if (dirty && DataContext is EditorViewModel editorVm)
                {
                    editorVm.Dock = Dock.Left;

                    // Selecting the document event though it already is, causes it to be removed from the temporary document cache.
                    editorVm.IsTemporary   = false;
                    shell.SelectedDocument = editorVm;
                }
            });

            _editor.AddHandler(PointerWheelChangedEvent, (sender, ee) => { _editorViewModel?.OnPointerWheelChanged(ee); }, Avalonia.Interactivity.RoutingStrategies.Tunnel, handledEventsToo: true);
        }
Esempio n. 3
0
 public void Dispose()
 {
     _editor   = null;
     _textArea = null;
 }