✅ make function sleep without freezing ui avalonia
ReturnUser
model, I can't figure out what to return in the if/else if
clauses.
2. My second issue is that when i click the Exit button, it's almost immediate. It takes a second or two and then the window closes, but then if I just leave username and password blank and click login, it takes nearly 6 seconds to figure whatever it needs to out and then it displays that the login was successful ...
3. which leads into #3 before #1 became an issue, I did have it to where the else clause was outside of the if statment and not in an else clause so that the code would execute if the check systems didn't fail, however, I think there was a problem with my check system. This is a link to the copy of the code that comes before #1 being an issue https://pastebin.com/jsb8nsqA
I'm not really sure what to do. I would like to keep the code I had before #1 became an issue as I was working on cleaning it up and making it better if we could go that route with this code https://pastebin.com/jsb8nsqA
MainWindowViewModel.cs (for reference): https://pastebin.com/R8e77kDa31 Replies
ok so I've identified where my problem lies
Use the /close command to mark a forum thread as answered
my problem is the
Thread.Sleep(6000);
What's supposed to happen here is it shows the error text and clear the username and password fields, then sleep 6 seconds, then hide the error and reset its text, but instead it's sleeping first, never showing anything, and then clearing the fields so any ideas on what's wrong with my logic? Full Code: https://pastebin.com/BMZB63yuUnknown User•9mo ago
Message Not Public
Sign In & Join Server To View
yea... I can't remember what the other thing is I'm supposed to use
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
gotcha
it's the dispatcher thing
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
never watched sw. sorry lol
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
😂
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
I"m a WoW player though
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
does that help?
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
oh ok
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
right
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
so the DispatcherTimer class
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
ok lol I understood that part already 😂 I'm asking am I supposed to use the DispatcherTimer class?
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
oh ok. tyvm
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
I don't use wpf. I use avalonia
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
yea I got the reference lol
https://reference.avaloniaui.net/api/Avalonia.Threading/DispatcherTimer/ see what I need to happen is when the if statement is triggered for the username or password not being right, it displays the error message and then after a few seconds hides the error message and resets the user's input. I just can't figure out where or how to do that.
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
sure...
i got it figured out