none
[UWP] ContactPanel questions RRS feed

  • Question

  • Hi,

    1)
    In the MSDN documentation for ContactPanel.LaunchFullAppRequested is mentioned, that if I don't handle the event or I don't set ContactPanelLaunchFullAppRequestedEventArgs.Handled to true, my app will be started in its default state. On my PC my app won't be started, if I keep the Handled property on false or if I don't subscribe the event. I have to write some code to start my app in default (== normal?) state. Is this a bug or am I misunderstanding something?

    2)
    In the MSDN documentation for ContactPanelLaunchFullAppRequestedEventArgs is mentioned, that I have to set ContactPanelLaunchFullAppRequestedEventArgs.Handled to true, if I start my app in its default state, and if I want to close my app window within the ContactPanel, I had to call ContactPanel.ClosePanel(), which I don't do. Because on my PC the behaviour is as follows: If I set Handled to true, the app window within ContactPanel will be automatically closed. If I set Handled to false, it prevents the app window within ContactPanel from closing. So to call ContactPanel.ClosePanel() is not necessarey, if I want to close the app window, and I must keep Handled on false, if I want the app window to remain open.

    It seems to be a crash in the ContactPanel, because the complete ContactPanel is closed, not only my app in the panel.

    3)
    In MSDN sample is used a method TryLaunchFullAppFromCurrentStateAsync(), which doesn't exist anywhere. I think, it's a placeholder. I use the following to start my own app. Is this the best and shortest way to open the own app?

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
    	base.OnNavigatedTo(e);
    
    	ContactPanelActivatedEventArgs	contactPanelArgs = e.Parameter as ContactPanelActivatedEventArgs;
    
    	if (contactPanelArgs != null)
    	{
    		ContactPanelContactId = contactPanelArgs.Contact?.Id;
    		contactPanelArgs.ContactPanel.LaunchFullAppRequested += ContactPanel_LaunchFullAppRequested;
    	}
    }
    
    private async void ContactPanel_LaunchFullAppRequested(ContactPanel sender, ContactPanelLaunchFullAppRequestedEventArgs args)
    {
    	if (!args.Handled)
    	{
    		// args.Handled = true	=> closes this app in ContactPanel.
    		// args.Handled = false	=> prevents this app in ContactPanel from closing.
    
    	//	args.Handled = true;
    	//	TryLaunchFullAppFromCurrentStateAsync();
    
    		await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () =>
    			{
    				// Add in Package-Manifest under Declarations the protocol 'ms-contact-profile'.
    
    				LauncherOptions	options = new LauncherOptions();
    
    				options.TargetApplicationPackageFamilyName = Package.Current.Id.FamilyName;
    				await Launcher.LaunchUriAsync(new Uri("ms-contact-profile:"), options);
    			});
    		
    	//	sender.ClosePanel();
    	}
    }

    I have a complete sample here.

    Best Regards,

    Heiko



    Thursday, April 4, 2019 4:42 PM

All replies

  • Hi HeiKo,

    I tested the UWP Official Contact Panel sample. It does work for me. Could you please first test the official sample on your side and tell me the result?

    Best Regards,

    Xavier


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, April 5, 2019 7:30 AM
    Moderator
  • Hi Xavier,

    thank you for your response. I testet the UWP Official Contact Panel Sample. Here the results:

    to 1)
    It's the same behaviour in the UWP Official Contact Panel Sample. If you don't subscribe the LaunchFullAppRequested event, the app won't be started automatically. You have to write code for starting the app in its default state.

    to 2)
    It's the same behaviour in the UWP Official Contact Panel Sample. The ContactPanel itself closes, if I click in menu in the upper right corner on .../Start 'Contact Panel C# sample'. In the handler for the LaunchFullAppRequested event args.Handled is set to true and this is the reason for that the ContatPanel itself closes completely, You can comment out the line 'sender.ClosePanel();'. It seems to be a crash of the ContactPanel.

    If you choose the MS People app in ContactPanel, then you can start the People app via the menu in ContactPanel, and the People app window in ContactPanel stays open.

    to 3)
    It's done the same manner in the UWP Official Contact Panel Sample. So it seems to be the right way to open the app.

    VS Community 2017, v15.9.11
    Windows 10.0.17763.379 Pro 64-bit, de-DE within a VMWare virtual machine

    Best Regards,
    Heiko



    Friday, April 5, 2019 3:24 PM
  • Hi,

    I had reproduced your issue. I'll ask the team to confirm this. There might be some time delay.

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Wednesday, April 10, 2019 9:37 AM
    Moderator