none
Application name in Windows 10's timeline - WinForms

    Pertanyaan

  • I have the following code:

    UserActivitySession _currentActivity;
    private async Task GenerateActivityAsync(){
       // Get the default UserActivityChannel and query it for our UserActivity. If the activity doesn't exist, one is created.
        UserActivityChannel channel = UserActivityChannel.GetDefault();
        UserActivity userActivity = await channel.GetOrCreateUserActivityAsync("Test");    // Populate required properties
        userActivity.VisualElements.DisplayText = "Test";
        userActivity.ActivationUri = new Uri(ActivityUri.Text); //ActivityUri is a textbox
        userActivity.VisualElements.Description = "This is test item";
        userActivity.VisualElements.Attribution =
            new UserActivityAttribution(new Uri("http://via.placeholder.com/16x16"))
            { AlternateText = "Test123" };
        //Save
        await userActivity.SaveAsync(); //save the new metadata
        // Dispose of any current UserActivitySession, and create a new one.
        _currentActivity?.Dispose();
        _currentActivity = userActivity.CreateSession();
    }

    And it results in something like on the screenshot: https://imgur.com/a/LK0NHAa

    I want my app's name to be displayed after the dash character (the dash is inserted there by Windows).

    03 Juni 2018 11:17

Semua Balasan

  • Hi Marcin,

    The UserActivityChannel is a UWP class, do you mean you used it in Winform application? If so, how? Maybe you need to provide more code here.

    >>I want my app's name to be displayed after the dash character (the dash is inserted there by Windows).

    I saw the picture you provided, but I'm sorry I didn't find anything related to winform, I can not understand what you mean that "want my app's name to be displayed after the dash character", how did you want to display it with winform?

    Please provide more details for your question.

    Regards,

    Frankie


    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.

    04 Juni 2018 9:22
  • I have used only this code, added references to Windows.Runtime.dll and Windows.winmd. This works the same way as in UWP but, when I write that with UWP, OS automatically obtains app name from manifest and adds there after dash character. I want to somehow specify the name to be displayed. (I want the header above card to be Test123 - Some App, but I don't know how to insert "Some App" there)

    Visual Studio and MS Office apps can do that (when they add entry to Timeline, app name is shown)

    04 Juni 2018 13:20
  • Hi Marcin,

    This forum is discussing and asking questions about the Windows Form and ClickOnce, if you have any question related to Winform and Clickonce, you can ask it here, but I'm afraid your question is not related to Winform, if you have problem related to MS office, it will be more appropriate to ask your question at Microsoft Office for Developers Forum.

    Please let me know if I misunderstand your question.

    Thanks for your understanding.

    Regards,

    Frankie


    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.

    05 Juni 2018 2:39