is it possible to fire a button Click event in code behind in user control?
标签:
silverlight-4.0
相关问题
- AesManaged and RijndaelManaged
- Silverlight with RIA services on IIS 10.0 results
- Silverlight 4: Where is the HtmlBrush?
- UpdateSourceTrigger PropertyChanged in Silverlight
- Could not load file or assembly > 'System.Wind
相关文章
- Live streaming with silverlight 4
- How do I debug my Silverlight 4 application?
- How to open window pop-up from Silverlight Out-of-
- Dynamically Creating Controls Following MVVM patte
- Silverlight 4 + MVVM + KeyDown event
- How can I get Silverlight 4 Tools to work in Web D
- How to parse the JSON Array value in C# (Windows p
- Why is WPF loosing terrain with Silverlight 4 comi
In C# events can only be invoked from the class that declares them. In case of the Button there is a method called OnClick which raises the ClickEvent but it is protected. So you need to declare class that inherits from Button and change the visibility of OnClick method (or declare some over method that calls base.OnClick)
Example of XAML
And code behind:
Though it is always easier to call event handler directly.
Then there will be no need for extra plumbing.