4

I'm trying to figure out how to change the style of the AvalonEdit CodeCompletion window. However, I can't figure out the right combination of xaml style target/properties to change it. The main thing I'd like to do is get rid of the border, but maybe some additional changes as well.

Here is the xaml I've tried. None of it is affecting the UI.

    xmlns:ae="clr-namespace:ICSharpCode.AvalonEdit.CodeCompletion;assembly=ICSharpCode.AvalonEdit"

    <Style TargetType="{x:Type ae:CompletionWindow}">
        <Setter Property="WindowStyle" Value="None" />
    </Style>
    <Style TargetType="{x:Type ae:CompletionWindowBase}">
        <Setter Property="WindowStyle" Value="None" />
    </Style>
    <Style TargetType="{x:Type ae:CompletionListBox}">
        <Setter Property="Background" Value="Red" />
    </Style>
    <Style TargetType="{x:Type ae:CompletionList}">
        <Setter Property="Background" Value="Orange" />
    </Style>
Keith G
  • 4,400
  • 5
  • 36
  • 46

2 Answers2

3

Use this style to remove border on window:

<Style TargetType="{x:Type avalonEdit:CompletionWindow}">
    <Setter Property="WindowStyle" Value="None"></Setter>
    <Setter Property="ResizeMode" Value="NoResize"></Setter>
    <Setter Property="BorderThickness" Value="0"></Setter>
</Style>
チーズパン
  • 2,672
  • 8
  • 38
  • 58
-2

To make the styles affect the UI, you can put them in a resource dictionary xaml and parse that with (ResourceDictionary)XamlReader.Parse(ResourcesAsXaml). Then assign the ResourceDictionary to the Resources property of the CompletionWindow.

Michael Rätzel
  • 371
  • 5
  • 17