Hi. I'm wondering how to communicate with this Page class defined in Page.xaml.cs:
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
}
private void TextBlock_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (HelloWorldTextBlock.Text == "Hello World")
HelloWorldTextBlock.Text = "I've been clicked";
else
HelloWorldTextBlock.Text = "Hello World";
}
public void foo() {}
}
From a webpart that creates the silverlight object here:
protected override void CreateChildControls()
{
base.CreateChildControls();
System.Web.UI.SilverlightControls.Silverlight ctrl = new System.Web.UI.SilverlightControls.Silverlight();
ctrl.ID = "SLHelloWorld";
ctrl.Source = SPContext.Current.Site.Url + "/XAPS/SL.XAML.HelloWorldRTM.xap";
ctrl.Width = new Unit(400);
ctrl.Height = new Unit(310);
Controls.Add(ctrl);
}