【发布时间】:2016-01-10 08:33:04
【问题描述】:
我在 C# 中有非常简单的代码来呈现 MessageBox:
MessageBox.Show("Hello Action!");
现在我需要执行以下操作:将 MessageBox 替换为 Silverlight ChildWindow 元素,添加标签、按钮和文本框,然后按下按钮将标签内容更新为文本框内容。
怎么做? 我没有在网上找到一些例子。
我的完整代码是这样的:
namespace DevTrainingSilverlight2
{
public class HelloAction : W6Action
{
public override void Initialize(W6ActionConfigSection configuration, UIElement containingControl, UIElement associatedControl)
{
base.Initialize(configuration, containingControl, associatedControl);
}
public override void UpdateState(System.Collections.IList selectedObjectsInFocus)
{
base.UpdateState(selectedObjectsInFocus);
}
public override void Invoke(System.Collections.IList selectedObjectsInFocus)
{
base.Invoke(selectedObjectsInFocus);
MessageBox.Show("Hello Action!");
}
}
}
【问题讨论】:
标签: c# silverlight visual-studio-2012 silverlight-5.0