dancepanda42
dancepanda42
CC#
Created by stigzler on 4/27/2024 in #help
✅ WPF - how to correctly call a method in the ViewModel when an event occurs in the View?
Simple answer, a event handler has no return type. The method should look like this: private async void MyToolWindow_LoadedAsync(object sender, RoutedEventArgs e) But the right way with a viewmodel is the MVVM Pattern. https://learn.microsoft.com/de-de/archive/msdn-magazine/2009/february/patterns-wpf-apps-with-the-model-view-viewmodel-design-pattern
15 replies
CC#
Created by JimmyCooks on 12/24/2022 in #help
❔ StackOverFlow bug
This way you have an infinite while loop
32 replies
CC#
Created by JimmyCooks on 12/24/2022 in #help
❔ StackOverFlow bug
The num variable never seems to be increased.
32 replies
CC#
Created by .logik. on 11/26/2022 in #help
Application called an interface that was marshalled for a different thread?
Glad I could help.
31 replies
CC#
Created by .logik. on 11/26/2022 in #help
Application called an interface that was marshalled for a different thread?
Especially when you operate on several different platforms.
31 replies
CC#
Created by .logik. on 11/26/2022 in #help
Application called an interface that was marshalled for a different thread?
I think the class mainthread is the way to go.
31 replies
CC#
Created by .logik. on 11/26/2022 in #help
Application called an interface that was marshalled for a different thread?
31 replies
CC#
Created by .logik. on 11/26/2022 in #help
Application called an interface that was marshalled for a different thread?
Hi, you could try to get a reference of the UI thread through the SynchronisationContext class https://learn.microsoft.com/en-us/dotnet/api/system.threading.synchronizationcontext?view=net-7.0 In the constructor store the SynchronisationContext.Current value in a Private filed. So you can call the Post mehtod in your Event handler to execute the passed method on the UI thread.
31 replies
CC#
Created by edgarka_ on 11/23/2022 in #help
❔ ❔ Bind selected items
sure am but in the Berlin time zone... so I'm no longer so long online. but you can send me a PM then I answer as soon as I find time.
28 replies
CC#
Created by edgarka_ on 11/23/2022 in #help
❔ ❔ Bind selected items
your welcome
28 replies