Skip to content

How to set TextEditor.TextArea.XxxProperty in xaml? #274

Answered by siegfriedpammer
GF-Huang asked this question in Q&A
Discussion options

You must be logged in to vote

These properties are not attached properties, thus cannot be set inline like you want to do it. However, you can use a style to set these properties:

<Style TargetType="avalonEdit:TextArea">
	<Setter Property="SelectionBrush">
		<Setter.Value>
			<SolidColorBrush Color="Red" Opacity="0.7" />
		</Setter.Value>
	</Setter>
</Style>

<Style TargetType="avalonEdit:TextView">
	<Setter Property="CurrentLineBackground">
		<Setter.Value>
			<SolidColorBrush Color="Green" Opacity="0.7" />
		</Setter.Value>
	</Setter>
</Style>

Hope this helps!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@GF-Huang
Comment options

Answer selected by GF-Huang
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants