Dingus
Updating datagrid gui from other threads
sweet. If another column and property was made called "RandomInt", then would that mean that
1. I would need to set up another "public int RandomInt" with get/set where I would also need to pass the onpropertyChanged event handler to
2. that "string? name =" would equal "RandomInt" as the value?
36 replies
Updating datagrid gui from other threads
'protected void OnPropertyChanged([CallerMemberName] string name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}'
Mainly what does "[CallerMemberName] string name = null" even define. Is this the object, the binding name, or the property of object (and if property does that mean that then the function uses this method to update other columns of different values that change as well?)
36 replies
Updating datagrid gui from other threads
youre totally fine. I really appreciate the help! I just want to make sure I understand what I am doing wrong and understand the concepts behind what I need rather than just copy paste. again thank you so much!
36 replies
Updating datagrid gui from other threads
you're an actual godsend. unfortunately I still cant wrap my head around the onpropertychanged function. I will do research to break that function down so I understand what the definition of each part means!
36 replies
Updating datagrid gui from other threads
I am trying to learn mvvm right now to see if maybe that was the aproach that I needed. I'm just having a lot of trouble wrapping my head around the concepts of the viewmodel that I see make into a INotifyClass. If you know/have any super simple examples of a mvvm approach with just like a single variable to change that would be greatly appreaciated!
I believe that even if I got mvvm approach working though that the datagrid would still need to refresh to show the objects updated progress through its progress bar unless there is some magical sorcery I dont know that allows a single cell to refresh rather than the row.
36 replies
WPF possible threading issue?
The updateDeviceWithFiles gets into the weeds of the program. I actually discovered I was missing an important method of the class I am using with all the dll imports from setupapi.dll in windows. updateDeviceWithFiles goes essentially like this though. I am testing right now with the new function and seeing how it works then will report back here if I still have the same issue
10 replies
WPF possible threading issue?
The issue starts when I press button in datagrid that is beside objects listed usb path
Right now the device communication works wonderfully and all files are sent to the device. The application doesn't freeze up since I am using the new thread to actually send the files. HOWEVER I update a ton of devices. (4 at once usually). When all files are sent a the device I have device removed from datagrid so I assume it does not exist anymore and Garbage collecter reclaims the memory. It always happens at the 6th device when I press its update button debugger in visual studio says System.OutofMemoryException and points to threading method of claiming thread.
What I think is happening is that after worker finishes sending files to device the thread is not actually disposed and Visual Studio thinks I am just infinitely trying to claim threads so visual studio yells at me. If I am not implementing threading right please tell me a more proper way to do it! This program has been months in the making by myself trying to figure out USB protocol and file handling. I just want to be able to update all my devices at once!
10 replies
❔ Converting from string into hex literal
from what the method shows and asks for is that it needs the PID and VID of a device in a integer format however defining them as decimal values will not let the device appear and only allows it to appear when I define the values in a hexadecimal value. I appreciate the help in understanding this and I will see about waiting and contacting the developers of the library.
35 replies
❔ Converting from string into hex literal
When using the libusbdotnet library, in order to open the device for usb communication it asks for the vid and pid as a int but if I give it the actual interger value instead of the hex it says it is unable to open the device because it is not found. without changing any other code than just changing the values into their hex definition the method is now able to open the device. Would that mean the method in the library is recognizing them as 2 different values?
35 replies
USB and Csharp
Well with usb communication I’m not too familiar but through consulting with someone who programs for these devices for some reason their default driver doesn’t allow communication unless it’s through proprietary software (which is useless and broken). I work at a company that fixes up industrial hand scanners and am looking for a quicker and easier way to send files to the devices IPL (kinda think of it as a bios). Me and the guy I work under have discovered that replacing the OEM driver with the generic winusb driver allows communication in IPL mode from some other programs but we’re looking to make our own as we literally redo hundreds of these devices a week and trying to train new people on how our files work is a nightmare. I’m looking to make life simpler and easier for me and the company by making software that’s easier to understand and easier to pickup.
19 replies
USB and Csharp
Okay thanks for the advice! @TaF I am currently looking to send hex files to a usb controller device but I have found through research that replacing the devices current driver with the generic windows usb driver (WinUSB) might be a good way to start communication with it. I will start with the documentation in C that you’ve provided and see where I can get!
19 replies