✅ When I enter Visual Studio WPF, all lines of code in all scripts are underlined. How to fix this?

No description
14 Replies
Angius
Angius2w ago
What does it say when you hover over that with your mouse?
SparkyCracked
SparkyCracked2w ago
$code
MODiX
MODiX2w ago
To post C# code type the following: ```cs // code here ``` Get an example by typing $codegif in chat For longer snippets, use: https://paste.mod.gg/
SparkyCracked
SparkyCracked2w ago
The App.xaml
<Application x:Class="YourNamespace.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ResourceDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
<Application x:Class="YourNamespace.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ResourceDictionary.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
Your ResourceDictionary.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Example style -->
<Style x:Key="ExampleStyle" TargetType="Button">
<Setter Property="Background" Value="LightBlue"/>
</Style>
</ResourceDictionary>
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Example style -->
<Style x:Key="ExampleStyle" TargetType="Button">
<Setter Property="Background" Value="LightBlue"/>
</Style>
</ResourceDictionary>
@Lerock (Pan Bułka) The above is just the syntax and example of using a resource dictionary
SparkyCracked
SparkyCracked2w ago
I would assume the error would be in the actual ResourceDictionary file you have, 'MenuButtonTheme' file. Just check the syntax there
Lerock (Pan Bułka)
wait I restarted the Visual Studio 5th time and it is fixed now
SparkyCracked
SparkyCracked2w ago
That is so weird lmao. At least it is fixed now.
Lerock (Pan Bułka)
Yeah, Thank you for help
SparkyCracked
SparkyCracked2w ago
$close
MODiX
MODiX2w ago
If you have no further questions, please use /close to mark the forum thread as answered
Lerock (Pan Bułka)
twoja stara
canton7
canton72w ago
Normally rebuilding the project helps with those sorts of WPF errors
Want results from more Discord servers?
Add your server
More Posts