nooogle / CDS.CSharpScripting

Drop-in user control for C# editing with intellisense and compilation. Script compilation and execution classes for GUI and console applications.
MIT License
9 stars 3 forks source link

CodeActions menu not using action.Title #26

Open nooogle opened 3 years ago

nooogle commented 3 years ago

Can't figure how to make the code actions menus work the same way they do in RoslynPad or other WPF applications.

For example, in TableTweaker or RoslynPad, pressing control+. after a simple name violation of a class name produces this:

image

The app.xaml file contains this data template, which tells the menu which property from the code action to render:

<DataTemplate DataType="{x:Type codeActions:CodeAction}">
    <TextBlock Text="{Binding Title, Mode=OneTime}" />
</DataTemplate>

In my project it renders like this:

image

I.e. it's just using .ToString on the code action objects.

I can't figure how to get this data template, or equivalent, into this WinForms project :-(