Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug Silverlight 2 : RoutedEventArgs.Empty
3 replies. Latest Post by Allen Chen – MSFT on March 12, 2008.
(0)
Jason K
Member
2 points
2 Posts
03-10-2008 8:15 AM |
RoutedEventArgs.Empty is returning type EventArgs instead of type RoutedEventArgs.
private void UserControl_Loaded(object sender, RoutedEventArgs e){ SearchBtn_Click((object)SearchBtn, RoutedEventArgs.Empty);}private void SearchBtn_Click(object sender, RoutedEventArgs e){}
Throws exception: 'Argument '2': cannot convert from 'System.EventArgs' to 'System.Windows.RoutedEventArgs'
Cass
Contributor
3157 points
654 Posts
03-10-2008 8:46 AM |
Try
SearchBtn_Click((object)SearchBtn, New RoutedEventArgs);private void SearchBtn_Click(object sender, RoutedEventArgs e){}
or
SearchBtn_Click((object)SearchBtn, New EventArgs);private void SearchBtn_Click(object sender, EventArgs e){}
03-10-2008 10:18 AM |
I understand that the soultion to the problem is:
SearchBtn_Click((object)SearchBtn, new RoutedEventArgs());private void SearchBtn_Click(object sender, RoutedEventArgs e){}
Allen Ch...
Star
13862 points
1,803 Posts
03-12-2008 1:56 AM |
Hi:
Thanks for highlighting this issue. It's a known issue that has been submitted here:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=292848
It had been sent to the appropriate group.
Thanks again.