我想知道如何与 Page.xaml.cs 中定义的这个 Page 类进行通信:
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() {}
}
来自在此处创建 silverlight 对象的 webpart:
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);
}