What's new
  • Visit Rebornbuddy
  • Visit Resources
  • Visit API Documentation
  • Visit Downloads
  • Visit Portal
  • Visit Panda Profiles
  • Visit LLamamMagic

[Dev] WPF System.Windows.Window Help Please

no1knowsy

Well-Known Member
Joined
Feb 28, 2010
Messages
3,927
Reaction score
57
Okay so I've been trying to get this new Demonbuddy WPF plugin Config button system to work, and I'm failing at life.


I finally got Visual Studio to recognize what a System.Windows.Window is. I was missing a PresentationMain.dll or something.


Anyways, I set up a UserControl, and then realized that wouldn't work. So I changed it to inherit from : window and also in the xaml to <Window>
I don't get any errors in VS, but when Demonbuddy compiles it gives me the error
Code:
Message=The calling thread must be STA, because many UI components require this.
       Source=PresentationCore

I'll attach my files. It's for the BreakTaker plugin.
Attached is the VS debugger text as well as all source for .sln
You'll have to re-add in references to Demonbuddy.exe

From what I've seen from google searches it has to do with possible threading issues when it deals with UIs, but I couldn't find a way around it.
I tried the following:
Code:
public Window DisplayWindow        {
            get
            {
                return new BreakTakerWPF();
            }
        }

As well as:
public BreakTakerWPF BreakTakerUI = new BreakTakerWPF();


        public Window DisplayWindow
        {
            get
            {
                return BreakTakerUI;
            }
        }

Both caused compiler issues.


Plz help teh Panda! ;)
 

Attachments

Nothin?

Someone in the community has to have some knowledge other than just the Buddy Team.


Lets not just rely on them now.
 
This looks like an issue with DB, not your code. The thread loading the UI needs to be in a STA.
 
This looks like an issue with DB, not your code. The thread loading the UI needs to be in a STA.
I've been drinking a little atm...
But WTF is a STA?

Btw, ty for the response :)
 
Last edited:
Sound good.

Thanks eax :)
I have no idea what's going on with WPF so you've helped plenty already.
 
Its a tricky issue and its low priority compared to the bugs we have to fix before the 18th. I've made a ticket and it should be fixed by July 1; it will probably be a lot sooner but no promises.
 
Sounds good to me.
I got stuff to handle anyways, and that gives me some time.
 
Back
Top