Windows phone 7 如何根据用户在windows phone 8中选择的语言更改消息框按钮内容

Windows phone 7 如何根据用户在windows phone 8中选择的语言更改消息框按钮内容,windows-phone-7,windows-phone-8,localization,messagebox,Windows Phone 7,Windows Phone 8,Localization,Messagebox,我正在开发WindowsPhone8应用程序,这个应用程序应该可以用英语和阿拉伯语两种语言工作 在一些屏幕中,我会显示带有一些消息和按钮的消息框(确定,取消)。 当应用程序为英语时,按钮内容(确定和取消)以英语显示。很好。 但当应用程序以阿拉伯语运行时,按钮内容不会以阿拉伯语显示。它仅以英语显示 我应该如何根据语言更改按钮内容 谢谢您应该使用CustomMessageBox控件。 它可以很容易地本地化: CustomMessageBox messageBox = new CustomMessa

我正在开发WindowsPhone8应用程序,这个应用程序应该可以用英语和阿拉伯语两种语言工作

在一些屏幕中,我会显示带有一些消息和按钮的消息框(确定,取消)。 当应用程序为英语时,按钮内容(确定和取消)以英语显示。很好。

但当应用程序以阿拉伯语运行时,按钮内容不会以阿拉伯语显示。它仅以英语显示

我应该如何根据语言更改按钮内容

谢谢

您应该使用CustomMessageBox控件。 它可以很容易地本地化:

 CustomMessageBox messageBox = new CustomMessageBox()
    {                
        Caption = "Do you like this sample?",
        Message = "There are tons of things you can do using custom message boxes. To learn more, be sure to check out the source code at Codeplex.",
        LeftButtonContent = "yes",
        RightButtonContent = "no",
        IsFullScreen = (bool)FullScreenCheckBox.IsChecked
    };

在Windows Phone 8中,您可以访问Microsoft.Xna.Framework.GameServices,它有一个更通用的消息框,您可以使用,无需下载单独的库

IAsyncResult result = Microsoft.Xna.Framework.GamerServices.Guide.BeginShowMessageBox(
    AppResources.SmsConfirmText,
    "",
    new string[] { AppResources.OkText, AppResources.CancelText },
    0,
    Microsoft.Xna.Framework.GamerServices.MessageBoxIcon.None,
    null,
    null);

// Include following line if you want it to be synchronous
result.AsyncWaitHandle.WaitOne();

int? choice = Microsoft.Xna.Framework.GamerServices.Guide.EndShowMessageBox(result);
if(choice.HasValue)
{
    if(choice.Value==0)
    {
        // User clicked on the first button: AppResources.OkText
    }
    else if(choice.Value==1)
    {
        // User clicked on the second button: AppResources.CancelText
    }
}

来源:

我应该如何显示上述消息框。CustomMessageBox messageBox=new CustomMessageBox(){Caption=”“,Message=AppResources.SmsConfirmText,LeftButtonContent=AppResources.OkText,righButtonContent=AppResources.CancelText,};CustomMessageBoxResult=messageBox.Show();请告诉我我在最后一行得到了错误。把错误贴在这里。官方样本是。我得到了这个错误。在当前上下文中找不到FullScreen复选框。请明确将其设置为false,然后重试(
IsFullScreen=false
)。我认为页面上没有FullScreenCheckBox控件,这是一个示例代码。