Click here to Skip to main content
15,892,674 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Load dll client side Pin
Adriaan Davel3-Jan-10 19:41
Adriaan Davel3-Jan-10 19:41 
GeneralRe: Load dll client side Pin
Mark Salsbery3-Jan-10 19:56
Mark Salsbery3-Jan-10 19:56 
GeneralRe: Load dll client side Pin
Adriaan Davel3-Jan-10 20:33
Adriaan Davel3-Jan-10 20:33 
GeneralRe: Load dll client side Pin
Mark Salsbery3-Jan-10 20:44
Mark Salsbery3-Jan-10 20:44 
GeneralRe: Load dll client side Pin
Adriaan Davel4-Jan-10 2:44
Adriaan Davel4-Jan-10 2:44 
AnswerRe: Load dll client side Pin
Mark Salsbery24-Dec-09 8:39
Mark Salsbery24-Dec-09 8:39 
AnswerRe: Load dll client side Pin
Adriaan Davel3-Jan-10 22:05
Adriaan Davel3-Jan-10 22:05 
Question[WPF] XamlParseException ----> The calling thread must be STA Pin
pbalaga22-Dec-09 11:00
pbalaga22-Dec-09 11:00 
Hi,
currently I'm testing a really small WPF app that uses resources
from external sources and at first it appeared to work fine. Now,
magically, it's not even able to load a resource from the same assembly.

The following code:
Uri uri = new Uri("thewinda.xaml", UriKind.Relative);
Window w = Application.LoadComponent(uri) as Window;


causes a XamlParseException with the message:

Cannot create instance of 'thewinda' defined in assembly 'WpfTemplateTry, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation.  Error in markup file 'thewinda.xaml' Line 1 Position 9.


One of its inner exceptions says:
The calling thread must be STA, because many UI components require this.

This is quite weird as "thewinda.xaml" is a file added to the same project as my application.
I've read this error can be connected with threading/async issues, but I have no idea,
how I could apply this hint to my case.


This is the body of "thewinda.xaml":
<Window x:Class="WpfTemplateTry.thewinda"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">

</Window>

QuestionRe: [WPF] XamlParseException ----&gt; The calling thread must be STA Pin
Mark Salsbery23-Dec-09 7:06
Mark Salsbery23-Dec-09 7:06 
AnswerRe: [WPF] XamlParseException ----&gt; The calling thread must be STA Pin
pbalaga25-Dec-09 3:56
pbalaga25-Dec-09 3:56 
GeneralRe: [WPF] XamlParseException ----&gt; The calling thread must be STA Pin
Mark Salsbery25-Dec-09 8:02
Mark Salsbery25-Dec-09 8:02 
GeneralRe: [WPF] XamlParseException ----&gt; The calling thread must be STA Pin
pbalaga25-Dec-09 10:09
pbalaga25-Dec-09 10:09 
QuestionCreate Radio Button!! Pin
Sr...Frank22-Dec-09 4:08
Sr...Frank22-Dec-09 4:08 
AnswerRe: Create Radio Button!! Pin
Mark Salsbery22-Dec-09 5:59
Mark Salsbery22-Dec-09 5:59 
GeneralRe: Create Radio Button!! Pin
Sr...Frank22-Dec-09 6:24
Sr...Frank22-Dec-09 6:24 
GeneralRe: Create Radio Button!! Pin
Mark Salsbery23-Dec-09 6:21
Mark Salsbery23-Dec-09 6:21 
QuestionListBox Multi Selection without holding Shift Key? Pin
Member 232448321-Dec-09 20:14
Member 232448321-Dec-09 20:14 
QuestionFlow Layout versus Fixed Layout Pin
Richard Andrew x6421-Dec-09 13:08
professionalRichard Andrew x6421-Dec-09 13:08 
AnswerRe: Flow Layout versus Fixed Layout Pin
Aviad P.21-Dec-09 20:05
Aviad P.21-Dec-09 20:05 
QuestionResources and Deployment - App does not run Pin
cutudi21-Dec-09 3:59
cutudi21-Dec-09 3:59 
AnswerRe: Resources and Deployment - App does not run Pin
Pete O'Hanlon21-Dec-09 4:13
mvePete O'Hanlon21-Dec-09 4:13 
GeneralRe: Resources and Deployment - App does not run Pin
cutudi21-Dec-09 4:19
cutudi21-Dec-09 4:19 
QuestionSystem.Net.HttpWebRequest missing members Pin
Siberz21-Dec-09 3:43
Siberz21-Dec-09 3:43 
AnswerRe: System.Net.HttpWebRequest missing members Pin
Mark Salsbery21-Dec-09 13:20
Mark Salsbery21-Dec-09 13:20 
QuestionTranslate transform in code Pin
AghaKhan21-Dec-09 1:52
AghaKhan21-Dec-09 1:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.