G
Guest
Hi
I have a static event called PropertyChanged. PropertyChanged is a delegate
called PropertyChangedEventHandler(Object^ sender, PropertyChangedEventArgs^
e)
If I remove my PropertyChangeEventArg parameter from the delegate and
replace it with a string, the project compiles.
Here is a snippet of my code:
// FileSummary.h
public delegate void PropertyChangedEventHandler(Object^ sender,
PropertyChangedEventArgs^ e);
public ref class FileSummary sealed {
public:
static void SetProperty(String^ value);
static event PropertyChangedEventHandler^ PropertyChanged;
};
// FileSummary.cpp
void FileSummary::SetProperty(String^ value) {
...
PropertyChanged(FileSummary::typeid, gcnew PropertyChangedEventArgs(value));
}
// PropertyChangedEventArgs.h
public ref class PropertyChangedEventArgs sealed : EventArgs {
public:
PropertyChangedEventArgs(String^ value);
property String^ Value {
String^ get();
}
private:
String^ pValue;
};
// PropertyChangedEventArgs.cpp
PropertyChangedEventArgs:ropertyChangedEventArgs(String^ value) {
pValue = value;
}
Sring^ PropertyChangedEventArgs::Value::get() {
return pValue;
}
I know I must be missing something, but like I mentioned, if I replace
PropertyChangedEventArgs^ in the delegate signature with String^ the project
compiles and works as expected.
Any help would be greatly appreciated.
Craig
I have a static event called PropertyChanged. PropertyChanged is a delegate
called PropertyChangedEventHandler(Object^ sender, PropertyChangedEventArgs^
e)
If I remove my PropertyChangeEventArg parameter from the delegate and
replace it with a string, the project compiles.
Here is a snippet of my code:
// FileSummary.h
public delegate void PropertyChangedEventHandler(Object^ sender,
PropertyChangedEventArgs^ e);
public ref class FileSummary sealed {
public:
static void SetProperty(String^ value);
static event PropertyChangedEventHandler^ PropertyChanged;
};
// FileSummary.cpp
void FileSummary::SetProperty(String^ value) {
...
PropertyChanged(FileSummary::typeid, gcnew PropertyChangedEventArgs(value));
}
// PropertyChangedEventArgs.h
public ref class PropertyChangedEventArgs sealed : EventArgs {
public:
PropertyChangedEventArgs(String^ value);
property String^ Value {
String^ get();
}
private:
String^ pValue;
};
// PropertyChangedEventArgs.cpp
PropertyChangedEventArgs:ropertyChangedEventArgs(String^ value) {
pValue = value;
}
Sring^ PropertyChangedEventArgs::Value::get() {
return pValue;
}
I know I must be missing something, but like I mentioned, if I replace
PropertyChangedEventArgs^ in the delegate signature with String^ the project
compiles and works as expected.
Any help would be greatly appreciated.
Craig