mirror of
https://github.com/qmlnet/qmlnet.git
synced 2026-05-15 14:15:54 -06:00
[GH-ISSUE #210] Thread-safe #133
Labels
No labels
bug
enhancement
help wanted
help wanted
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/qmlnet#133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @FilipoGuci on GitHub (Jun 18, 2020).
Original GitHub issue: https://github.com/qmlnet/qmlnet/issues/210
Hello, I am a beginner C # developer. I am interested in your qml.net library, please tell me if it’s not difficult for you. Since I cannot use Dispatcher, how can I handle the event safely? Thanks in advance.
@pauldotknopf commented on GitHub (Jun 18, 2020):
Which event are you speaking of, specifically?
@FilipoGuci commented on GitHub (Jun 18, 2020):
For example, I have a library that sends, receives and decodes data, I create an event for decoding and subscribe to it in the main form, if you do not use the dispatcher, the form hangs
@pauldotknopf commented on GitHub (Jun 18, 2020):
I don't really know what you are asking. Can you provide a simple
Program.Mainwith some explanation?@FilipoGuci commented on GitHub (Jun 18, 2020):
lib.dll
public event EventHandler OnVersion;
public async Task Version()
{
//some actions
OnVersion?.Invoke(this, version);
}
Program.cs
uDP.OnVersion += UDP_OnVersion;
private void UDP_OnVersion(object sender, SomeEventsArgs e)
{
displayResult = $"Firmware version: {e.Version}"
}
@pauldotknopf commented on GitHub (Jun 18, 2020):
On the UDP_OnVersion, you must dispatch the data back to the UI thread with
QCoreApplication.Dispatch.