Click here to Skip to main content
15,792,771 members
Home / Discussions / C#
   

C#

 
GeneralRe: "interface hack" to make private nested class instances available to outer class methods ? Pin
Richard Deeming12-May-22 3:18
mveRichard Deeming12-May-22 3:18 
GeneralRe: "interface hack" to make private nested class instances available to outer class methods ? Pin
BillWoodruff12-May-22 3:32
professionalBillWoodruff12-May-22 3:32 
AnswerRe: "interface hack" to make private nested class instances available to outer class methods ? Pin
Richard MacCutchan11-May-22 4:19
mveRichard MacCutchan11-May-22 4:19 
GeneralRe: "interface hack" to make private nested class instances available to outer class methods ? Pin
BillWoodruff11-May-22 4:50
professionalBillWoodruff11-May-22 4:50 
GeneralRe: "interface hack" to make private nested class instances available to outer class methods ? Pin
harold aptroot11-May-22 11:28
harold aptroot11-May-22 11:28 
GeneralRe: "interface hack" to make private nested class instances available to outer class methods ? Pin
BillWoodruff11-May-22 18:34
professionalBillWoodruff11-May-22 18:34 
GeneralRe: "interface hack" to make private nested class instances available to outer class methods ? Pin
BillWoodruff12-May-22 2:14
professionalBillWoodruff12-May-22 2:14 
QuestionToast notification Collections crash when initializing. Pin
Maximilien9-May-22 4:12
Maximilien9-May-22 4:12 
I'm trying to setup a a ToastNotification collection for our toast notifications (which are working, we can create the notifications.)

I'm following this example : Toast Collections - Windows apps | Microsoft Docs

The collection is needed to set a custom name to the notification collections; it usually takes the assembly name. (which can be done but it's a hack)

The method is called after creating the main window.

The defaultManager has a member "User=null"; I'm not sure if it is a valid value for a Default Manager ?

It crashes when getting the GetToastCollectionManager :
System.Exception
  HResult=0x80070490
  Message=Element not found. (0x80070490)
  Source=<Cannot evaluate the exception source>
  StackTrace:
<Cannot evaluate the exception stack trace>

  This exception was originally thrown at this call stack:
    WpfApp1.MainWindow.CreateToastCollection() in MainWindow.xaml.cs
    WpfApp1.MainWindow.MainWindow() in MainWindow.xaml.cs

Any ideas ?
        private async void SetNotificationCollections()
        {
            string displayName = "Is Potato";
            string launchArg = "NavigateToPotato";
            System.Uri iconURI = new System.Uri("ms-appx:///Assets/icon.png");

<pre>
        ToastCollection licensingManagerToastCollection = new ToastCollection(
            "MyToastCollection",
            displayName,
            launchArg,
            iconURI);

        ToastNotificationManagerForUser defaultManager = ToastNotificationManager.GetDefault();

        try
        {
            ToastCollectionManager collectionManager = defaultManager.GetToastCollectionManager(); //CRASH/exception here.
            await collectionManager.SaveToastCollectionAsync(licensingManagerToastCollection);
        }
        catch
        {
            return;
        }
    }</pre>
CI/CD = Continuous Impediment/Continuous Despair


modified 9-May-22 9:32am.

AnswerRe: Toast notification Collections crash when initializing. Pin
Gerry Schmitz9-May-22 9:26
mveGerry Schmitz9-May-22 9:26 
GeneralRe: Toast notification Collections crash when initializing. Pin
Maximilien10-May-22 3:12
Maximilien10-May-22 3:12 
GeneralRe: Toast notification Collections crash when initializing. Pin
Gerry Schmitz10-May-22 8:36
mveGerry Schmitz10-May-22 8:36 
GeneralRe: Toast notification Collections crash when initializing. Pin
Maximilien10-May-22 8:59
Maximilien10-May-22 8:59 
GeneralRe: Toast notification Collections crash when initializing. Pin
Gerry Schmitz10-May-22 10:30
mveGerry Schmitz10-May-22 10:30 
GeneralRe: Toast notification Collections crash when initializing. Pin
Maximilien11-May-22 3:43
Maximilien11-May-22 3:43 
GeneralRe: Toast notification Collections crash when initializing. Pin
Sayyid Sadik12-Dec-22 5:35
Sayyid Sadik12-Dec-22 5:35 
GeneralRe: Toast notification Collections crash when initializing. Pin
Maximilien12-Dec-22 5:46
Maximilien12-Dec-22 5:46 
SuggestionRe: Toast notification Collections crash when initializing. Pin
Richard Deeming9-May-22 23:00
mveRichard Deeming9-May-22 23:00 
GeneralRe: Toast notification Collections crash when initializing. Pin
Maximilien10-May-22 3:12
Maximilien10-May-22 3:12 
QuestionAccess of simple activex component with only one method created in .net (using vb.net/c#) from child object created using window.open causes Catastrophic failure. Pin
Satheesh N9-May-22 3:13
professionalSatheesh N9-May-22 3:13 
SuggestionRe: Access of simple activex component with only one method created in .net (using vb.net/c#) from child object created using window.open causes Catastrophic failure. Pin
Richard Deeming9-May-22 3:34
mveRichard Deeming9-May-22 3:34 
GeneralRe: Access of simple activex component with only one method created in .net (using vb.net/c#) from child object created using window.open causes Catastrophic failure. Pin
Satheesh N10-May-22 0:06
professionalSatheesh N10-May-22 0:06 
GeneralRe: Access of simple activex component with only one method created in .net (using vb.net/c#) from child object created using window.open causes Catastrophic failure. Pin
Dave Kreskowiak10-May-22 2:36
mveDave Kreskowiak10-May-22 2:36 
AnswerRe: Access of simple activex component with only one method created in .net (using vb.net/c#) from child object created using window.open causes Catastrophic failure. Pin
OriginalGriff9-May-22 4:00
mvaOriginalGriff9-May-22 4:00 
QuestionHow to validate an URI ? Pin
Maximilien2-May-22 9:05
Maximilien2-May-22 9:05 
AnswerRe: How to validate an URI ? Pin
OriginalGriff2-May-22 9:27
mvaOriginalGriff2-May-22 9:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.