C
C#13mo ago
Ernoi

✅ New to wpf and need some help with architecture.

I have a game-listener that gets new information every second. I crreate an instance and start the listener when the wpf application starts(this is done in the app.xaml.cs). This game listener class has a eventhandler that sends back the GameState(all useful data from the game). Now my question is how to make the wpf side. I want to expose this data to the main window and keep it rendering when the data changes.
6 Replies
Bailey
Bailey13mo ago
Search on the internet how to use a background worker for the data and search for events. You can trigger an event to update the window
JakenVeina
JakenVeina13mo ago
I.E. you're building a reactive application, so start by looking at ReactiveExtensions and ReactiveUI
Ernoi
ErnoiOP13mo ago
Do you have a good read or video about it?
JakenVeina
JakenVeina13mo ago
funny you should mention..
JakenVeina
JakenVeina13mo ago
GitHub
Release Workshop Recording · JakenVeina/Battleship.NET
This is an edited recording of the workshop that was hosted in https://discord.gg/csharp, demonstrating this codebase.
Accord
Accord13mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server