TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Ron
NA
44
64.4k
Namespace can not be found
Apr 16 2012 11:07 AM
I'm new to WPF and I have what I believe to be a basic question:
I have the following code in the App.xaml file (simplified for clarity):
<Application x:Class="MyApp.App"
...
xmlns:local="clr-namespace:OpMenu_Image_Convert">
<Application.Resources>
<Style...>
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<StackPanel ...>
<Image Source="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType= {x:Type TreeViewItem}}, Path=Header,
Converter={x:Static local:HeaderToImageConverter.Instance}}" />
<Style />
<Application />
Also I have a file called OpMenu_Image_Convert.cs which contains this code:
using ...
namespace OpMenu_Image_Covert
{
#region HeaderToImageConverter
[ValueConversion(typeof(string), typeof(bool))]
public class HeaderToImageConverter : IValueConverter
{
public static HeaderToImageConverter Instance = new HeaderToImageConverter();
...
}
}
I know I've left out alot of code, but this was all tested and working until I changed the name of the namespace (and the file in which it's contained) to its new value of OpMenu_Image_Convert. Now when I attempt to run this app, I get an error:
The type or namespace name 'OpMenu_Image_Convert' could not be found (are you missing a using directive or an assembly reference?)
Any insight would be appreciated.
Reply
Answers (
4
)
How can i set image border with gradient using c# in WPF
Scrollable GridView With Fixed Headers in wpf.