2

我发现如何将命令(看起来像链接)添加到设置魅力:

SettingsPane.GetForCurrentView().CommandsRequested += MainPage_CommandsRequested;

        void MainPage_CommandsRequested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var cmd = new SettingsCommand("feedback", "Send feedback", new Windows.UI.Popups.UICommandInvokedHandler(x =>
            {
                App.ShowSendFeedback();
            }));

            args.Request.ApplicationCommands.Clear();
            args.Request.ApplicationCommands.Add(cmd);
        }

现在我需要将语言选择的下拉列表添加到设置魅力中。我怎样才能实现它?

4

2 回答 2

3

See also this blog post, which explains how you can display a custom user control whenever one of your settings are selected.

Basically, he moves an off-screen user control on-screen and then hides it again when user interaction is done. To me this feels kind of hack-ish... But I guess that's where WinRT is right now.

于 2012-05-26T13:50:27.777 回答
2

您不能将其直接添加到 Win8 UI。这个想法是将“命令”链接发布到 Win8 UI 中,然后,当它们被单击时,您的应用程序会收到通知。此时,您可以在其中显示您自己的 UI,其中包含您想要的任何小部件。有关示例,请参阅 SDK 中的任何设置示例。

于 2012-05-12T02:25:35.920 回答