Tueem
Tueem
CC#
Created by Tueem on 1/3/2024 in #help
Unsure on how to structure using OOP
Hey, I have written the following abstract class to abstract away different communication drivers like serial or udp/tcp and there is already a feature which sends ping messages and checks for a response to see if there is something on the other end of the port. But I think there is a better way to do this using more than one class. I also want to add a port connected check for when a usb gets yanked for example. How would you guys structure that? I'm also open for criticism about my already written code! This is the code https://pastebin.com/iQBTHVjG
10 replies
CC#
Created by Tueem on 11/5/2023 in #help
❔ Wpf massive memory overhead
Hey guys, I have this wpf window which enables me to select a rectangle on the screen. It gets opened on every available screen. But for some reason every time I open and close these windows (Im creating new ones) it adds like 100 - 200 MB to the unmanaged ram usage which doesn't get garbage collected. I will link the class that opens the windows and the window itself: Service: https://pastebin.com/NeKjVEHx Window CodeBehind: https://pastebin.com/gQgZgEuU Window XAML: https://pastebin.com/ZVeT8phX I'm also happy to receive any critizism about my code but please be polite, I've no Idea how to structure applications well but am eager to learn how.
4 replies
CC#
Created by Tueem on 11/5/2023 in #help
❔ WPF can't remove some kind of window title hitbox
So I've got this screenshot window which should basically be exactly like the Windows snipping tool and not expose any sort of window control except the ones I specify. XAML Code: https://pastebin.com/Wyxi1H63 As you can see I've done WindowStyle=None and the WindowChrome stuff. But for some reason there is still some kind of title bar left that changes the type of cursor, enables me to drag the window and on right click shows me this weird context menu. (as seen in the attachment video) Basically I just want to disable that completely while simultaneously preserving all window functions like key events.
4 replies