Open Abenstex opened 1 year ago
Hi @Abenstex -- can you tell us what you mean by referencing in the XAML file for your use case? WPF? UWP? MAUI?
Hi @timheuer
I was refering to the .Net MAUI extension for VSCode.
Much needed feature. In the meantime, how do you go about referencing the file in the .csproj file?
Hi @Abenstex -- can you tell us what you mean by referencing in the XAML file for your use case? WPF? UWP? MAUI?
I think the OP (and myself) are looking for the equivalent of these lines in the csproj and how to reference them in the xaml (when using VS Code). I am stuck as well. Most docs refer to the use of VS Studio (using the Designer tool).
<ItemGroup>
<Compile Update="Resources\Strings\AppResources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>AppResources.resx</DependentUpon>
</Compile>
<EmbeddedResource Update="Resources\Strings\AppResources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>AppResources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<MauiXaml Update="LocalizedPage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
</ItemGroup>
<Label FontSize="16" FontAttributes="Bold"
TextColor="Black"
x:Name="IntroductionLabel1"
Text="{x:Static strings:AppResources.WelcomeLabel}"
/>
MainPage.xaml(60,25): XamlC error XFC0000: Cannot resolve type "clr-namespace:speech_to_text.Resources.Strings:AppResources"
https://learn.microsoft.com/en-us/dotnet/maui/fundamentals/localization?view=net-maui-8.0
Type: Feature Request
After adding *.resx files to my project, I cannot reference them in the XAML file. After some research in the internet it seems as if the resx have to be added to the csproj file of the project. However, documentation is very very very sparse, so some automated support for this would be highly appreciated.
Extension version: 0.1.34 VS Code version: Code 1.80.1 (74f6148eb9ea00507ec113ec51c489d6ffb4b771, 2023-07-12T17:22:07.651Z) OS version: Windows_NT x64 10.0.22621 Modes:
| VS Bug 2000459