I created a Folder in my Solution and named it "Brushes". Then I added a ResourceDirectory to that folder and now, whenever i compile, Visual Studio automatically adds using mySolutionName.Brushes
to MainWindow.gs and then says that Brushes is not avaiable in the solution. I don't untderstand why it even adds this code...
I want to store some brushes in that ResourceDictionary which I can then access with
Brush getBrush(string BrushName)
{
ResourceDictionary BDef = new ResourceDictionary();
BDef.Source = new Uri("Brushes/myBrushes.xaml", UriKind.Relative);
return (Brush)BDef[BrushName];
}
Visual Studio automatically adds a using statement if you tried to use a Resource from the Resource folder you just created.
The compilation error you're getting is probably because you deleted or moved your folder. Try deleting the folder in Visual Studio and in Windows Explorer and add it again.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.