Hello everyone, I have a few questions:
Im updating my plugin for the 2021 version of Studio. Ive made my main window a Wpf Xaml Window (it all seems to work/load correctly). Im trying to localize it following the example here:
The resource file is not visible in the Main Window, when I attempt to bind a string to a control. Any suggestions as to how I could "reach" it? I get the feeling part of the issue might be related to the type of VS project. Also: I tried moving the Resx file to another location in the project, but, when compiling, I get error messages stating that the Resx file cannot be found. "Failed to load plug-in resx file... could not find file PluginResource"... Is there an API/Compiler trick to have it referenced the Resx file from a folder of my choosing? Overall, Ive used a Dynamic Resources approach to handle the L10N process, but, it involve the inclusion of addition Xaml files. I figured, if I could actually use the Plugin resource files, it would save me some extra manipulations.
<Window x:Class="TestProvider.Views.MainWindow"
xmlns="">schemas.microsoft.com/.../presentation"
xmlns:x="">schemas.microsoft.com/.../xaml"
xmlns:d="">schemas.microsoft.com/.../2008"
xmlns:mc="">schemas.openxmlformats.org/.../2006"
xmlns:local="clr-namespace:TestProvider.Views"
xmlns:L10N="clr-namespace:TestProvider"
xmlns:VM="clr-namespace:TestProvider.ViewModels"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Window.DataContext>
<VM:MainWindowViewModel/>
</Window.DataContext>
<Grid>
<StackPanel Orientation="Vertical">
<TextBox x:Name="m_tbApiKey" Text="{Binding EngineName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Margin="5" Width="150" Height="30"/>
<Button Width="100" Height="30" Margin="5" Content="{x:Static L10N:MyTranslationProvider.}" Command="{Binding SaveOptionsCommand}"/>
</StackPanel>
</Grid>
</Window>