【问题标题】:Using CustomMessageBox with WP8在 WP8 中使用 CustomMessageBox
【发布时间】:2014-01-01 11:46:30
【问题描述】:

在我的 WP8 应用程序中,我必须使用 CustomMessageBox。我使用 VB.NET 并看到 here 我必须使用我添加到 XAML 中的 WP Toolkit,如下所示:

xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"

我想做的事情很简单,不复杂的消息框中的其他控件,只是修改按钮文本。 现在我的问题很简单:我无法创建我的 CustomMessageBox 对象。在我提供的链接上,您可以看到示例是:

CustomMessageBox messageBox = new CustomMessageBox()

带有一些参数。它是 C#,但基本上它应该以这种方式与 VB.NET 一起使用:

Dim myMessageBox as CustomMessageBox = new CustomMessageBox()

但 Visual Studio 说“类型 CustomMesageBox 未定义”。任何的想法 ? 谢谢

【问题讨论】:

    标签: vb.net xaml windows-phone-8


    【解决方案1】:

    假设您已经下载了工具包并将其添加为项目参考,可能您错过了添加 Imports(C# 中的using):

    Imports Microsoft.Phone.Controls
    

    【讨论】:

    • 不,不是这个,因为我的代码开头有这些语句:Imports System.Net.Http Imports System.Threading.Tasks Imports System.IO.IsolatedStorage Imports System.Windows.Controls Imports Microsoft.Phone.Controls Imports System.Windows Imports System
    • 我尝试使用VB创建新的WP 8项目,从nuget安装WP工具包,并且CustomMessageBox被识别...尝试使用像Microsoft.Phone.Controls.CustomMessageBox这样的全名是否有效?
    • 或者我的假设是错误的,你没有添加对 Microsoft.Phone.Controls.Toolkit.dll 的引用?
    • 感谢您的回答。事实上这个包没有安装(但我不明白为什么,我记得安装过)
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-26
    • 2013-01-04
    • 1970-01-01
    • 2014-06-14
    • 1970-01-01
    • 2014-01-11
    相关资源
    最近更新 更多