2012-11-02 92 views
0

我想授予用户重新命名文件的权限。为此当用户点击菜单项'重命名'弹出对话框和可编辑文本框应显示'确定'和'取消'按钮?我如何实现它?如果有任何请分享代码。在windows phone 7中弹出可编辑文本

BR, 急怒

回答

1

您可以使用InputPromptCoding4fun Tookit

该文档可在Codeplex:http://coding4fun.codeplex.com/wikipage?title=InputPrompt&referringTitle=Documentation

调用它很简单:

var input = new InputPrompt(); 
input.Completed += InputCompleted; 
input.Title = "Rename file"; 
input.Message = "Enter a new name for the file:"; 
input.Show(); 

然后你只需检索回调中的值:

private void InputCompleted(object sender, PopUpEventArgs<object, PopUpResult> e) 
{ 
    MessageBox.Show(e.Result); 
} 
+0

Thanks.Laying使用第三方库,我可以使用silverlite本身的一些类吗? –

+0

你当然可以。使用例如'Popup'控件,可以自由构建您自己的InputPrompt。 –