Files
ILSpy/TestPlugin/CustomOptionsView.axaml
Siegfried Pammer 461faeda58 Port the sample plugin to Avalonia
TestPlugin was still WPF (net10.0-windows, UseWpf, System.Windows,
TomsToolbox, the old ICSharpCode.ILSpy namespace), so it could not load
into the cross-platform app. Re-target it to net10.0 and map each
extension point onto the port's contracts: the custom Language, About-page
addition, context-menu entry, main-menu/toolbar command, and an Avalonia
options page whose view the ViewLocator resolves by naming convention. The
command needs [ImportingConstructor] for System.Composition to satisfy its
service dependency. Reference it build-only from the tests (no DLL copied
into the test output) so a composition test can load it without the
headless app auto-loading the plugin into every other test.

Assisted-by: Claude:claude-opus-4-8:Claude Code
2026-06-08 18:34:56 +02:00

16 lines
715 B
XML

<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:TestPlugin"
x:Class="TestPlugin.CustomOptionsView"
x:DataType="vm:CustomOptionsViewModel">
<StackPanel Spacing="6" Margin="6">
<CheckBox IsChecked="{Binding Options.UselessOption1, Mode=TwoWay}"
Content="A completely useless option" />
<StackPanel Orientation="Horizontal" Spacing="6">
<TextBlock Text="Another useless option:" VerticalAlignment="Center" />
<Slider Minimum="0" Maximum="100" Width="200"
Value="{Binding Options.UselessOption2, Mode=TwoWay}" />
</StackPanel>
</StackPanel>
</UserControl>