Line Number Margin is clipped when MinWidth for EditorLineNumberMargin is set

SyntaxEditor for WPF Forum

Posted 3 years ago by Erwin Liong
Version: 16.1.0631
Platform: .NET 4.0
Environment: Windows 7 (64-bit)
Avatar

Hi Actipro,

 

I made a small modification to the [view]\Actipro Software\WPF-Controls\v16.1.0631\SampleBrowser\ProductSamples\SyntaxEditorSamples\QuickStart\EditorViewMarginsVisibility\MainControl.xaml to restrict the MinWidth of EditorLineNumberMargin to 10. Code as follow:

<UserControl 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared" 
	xmlns:editor="http://schemas.actiprosoftware.com/winfx/xaml/syntaxeditor" 
    xmlns:system="clr-namespace:System;assembly=mscorlib"
	xmlns:editorPrimitives="clr-namespace:ActiproSoftware.Windows.Controls.SyntaxEditor.Primitives;assembly=ActiproSoftware.SyntaxEditor.Wpf"
    >
	<UserControl.Resources>

		<Style TargetType="{x:Type editorPrimitives:EditorLineNumberMargin}">
                <Setter Property="MinWidth" Value="10" />
            </Style>
	
	</UserControl.Resources>
	<DockPanel>

On the sample "Editor View Margins - Visibility", I added many lines (more than 10 lines).

Next, I toggle to set the Line number margin visibility to be Visible.

Observe that the line numbers are clipped. The expected behavior would be the line number margin would resize accordingly.

 

Please help me with a fix. Thank you.

Comments (3)

Answer - Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Erwin,

Thanks for letting us know about this.  We've fixed it for the next maintenance release.

You can work around the problem for now by calling this after making the line number margin visible:

editor.InvalidateViews()


Actipro Software Support

Posted 3 years ago by Erwin Liong
Avatar

Thanks, Actipro.

By the way, when is the next maintenance release?

Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

We aren't sure yet when the next maintenance release will be yet since one recently came out.  You can use the workaround mentioned above in the meantime.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.