Silverlight UserControl with rectangle as a button
Posted
by Rafal
on Stack Overflow
See other posts from Stack Overflow
or by Rafal
Published on 2010-03-17T13:15:57Z
Indexed on
2010/03/18
23:31 UTC
Read the original article
Hit count: 395
Hi,
I have a problem using custom made UserControl in Silverlight Page. The UserControl is generally a rectangle containing a smaller rectangle inside. I want to use the UControl in a Silverlight MainSite. i've implemented a method on mouse button down for a smaller rectangle called in here Button1:
public void Button1_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
MessageBox.Show("Hello");
}
How can i use it from a MainSite? From there I can only implement a method like:
private void ImportedControl_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
firstLeaf.Button1_MouseLeftButtonDown(sender, e);
}
I can not implement a method for Button1.
How can i mek this Work? HELP:)
© Stack Overflow or respective owner