Exemple #1
0
        private async void PrintPackage()
        {
            // register the PrintTaskRequest callback to get the Printing3D3MFPackage.
            var print3DManager = Print3DManager.GetForCurrentView();

            print3DManager.TaskRequested += OnTaskRequested;

            // show the PrintUI
            var result = await Print3DManager.ShowPrintUIAsync();

            // Remove the print task request after the dialog is complete.
            print3DManager.TaskRequested -= OnTaskRequested;
        }
Exemple #2
0
    private async void LaunchPrintDialog()
    {
        labelText = Step2;
        // use CreateData to create 3MFPackage from a string stream
        await CreateData();

        labelText = Step3;
        // register the PrintTaskRequest callback to get the Printing3D3MFPackage
        Print3DManager.GetForCurrentView().TaskRequested += MainPage_TaskRequested;

        // show the PrintUI
        await Print3DManager.ShowPrintUIAsync();

        // remove the print task request after dialog is shown
        Print3DManager.GetForCurrentView().TaskRequested -= MainPage_TaskRequested;

        // set back
        enableButton = true;
    }
        // </SnippetSaveModel>

        // <SnippetRegisterMyTaskRequested>
        private async void OnPrintClick(object sender, RoutedEventArgs e)
        {
            // get a reference to this class' Print3DManager
            Print3DManager myManager = Print3DManager.GetForCurrentView();

            // register the method 'MyTaskRequested' to the Print3DManager's TaskRequested event
            myManager.TaskRequested += MyTaskRequested;
            // </SnippetRegisterMyTaskRequested>

            // <SnippetShowDialog>
            // show the 3D print dialog
            OutputTextBlock.Text = "opening print dialog";
            var result = await Print3DManager.ShowPrintUIAsync();

            // </SnippetShowDialog>

            // <SnippetDeregisterMyTaskRequested>
            // remove the print task request after dialog is shown
            myManager.TaskRequested -= MyTaskRequested;
        }