none
[UWP]Questions about ContentDialog

All replies

  • You could create a new window: https://social.msdn.microsoft.com/Forums/sqlserver/en-US/f1328991-b5e5-48e1-b4ff-536a0013ef9f/uwpis-it-possible-to-open-a-new-window-in-uwp-apps?forum=wpdevelop

    ...and put any content you want in the Page (YourPageWithTheListBox in the sample code below) that you that you set as the Content of the new window or its Frame:

    private async void Button_Click(object sender, RoutedEventArgs e)
            {
                var currentAV = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
                var newAV = Windows.ApplicationModel.Core.CoreApplication.CreateNewView();
                await newAV.Dispatcher.RunAsync(
                                Windows.UI.Core.CoreDispatcherPriority.Normal,
                                async () =>
                                {
                                    var newWindow = Window.Current;
                                    var newAppView = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView();
                                    newAppView.Title = "New window";
    
                                    newWindow.Content = new YourPageWithTheListBox();
                                    newWindow.Activate();
    
                                    await Windows.UI.ViewManagement.ApplicationViewSwitcher.TryShowAsStandaloneAsync(
                                        newAppView.Id,
                                        Windows.UI.ViewManagement.ViewSizePreference.UseMinimum,
                                        currentAV.Id,
                                        Windows.UI.ViewManagement.ViewSizePreference.UseMinimum);
                                });
            }
    

    Hope that helps.

    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    Wednesday, December 14, 2016 7:35 PM
  • hello:

    I want to do this whit modal windows


    • Edited by Javier Ra Thursday, December 15, 2016 8:22 AM modificar
    Thursday, December 15, 2016 8:19 AM
  • Then you should create a Page that look like that and set the Content property of the window an instance of this page:

    newWindow.Content = new Page1();

    If you want someone to create the entire page for you, the forums is not the right place. Then you should probably hire a developer. The forums are for helping solving specific issues, not for anyone else to do your work for you :)

    Hope that helps and good luck.

    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.

    Friday, December 16, 2016 9:14 PM
  • ContentDialog can be used for this.

    Check my apps: Share to Speech and File Cards

    Saturday, December 17, 2016 8:56 PM
  • Hello:

    in the ContentDialog is can remove those buttons default to close Contentdialog by buttons normal

    Monday, March 20, 2017 2:30 PM