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

No description
14 Replies
Angius
Angius5mo ago
What does it say when you hover over that with your mouse?
SparkyCracked
SparkyCracked5mo ago
$code
MODiX
MODiX5mo 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
SparkyCracked5mo 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
SparkyCracked5mo 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
SparkyCracked5mo ago
That is so weird lmao. At least it is fixed now.
Lerock (Pan Bułka)
Yeah, Thank you for help
SparkyCracked
SparkyCracked5mo ago
$close
MODiX
MODiX5mo ago
If you have no further questions, please use /close to mark the forum thread as answered
Lerock (Pan Bułka)
twoja stara
canton7
canton75mo ago
Normally rebuilding the project helps with those sorts of WPF errors
Want results from more Discord servers?
Add your server