Click here to Skip to main content
15,886,873 members
Home / Discussions / WPF
   

WPF

 
QuestionCommand for Button, check if right clicked Pin
ezazazel20-Sep-09 5:57
ezazazel20-Sep-09 5:57 
AnswerRe: Command for Button, check if right clicked Pin
ABitSmart20-Sep-09 14:07
ABitSmart20-Sep-09 14:07 
GeneralRe: Command for Button, check if right clicked Pin
ezazazel21-Sep-09 4:58
ezazazel21-Sep-09 4:58 
AnswerRe: Command for Button, check if right clicked Pin
Gideon Engelberth20-Sep-09 14:08
Gideon Engelberth20-Sep-09 14:08 
GeneralRe: Command for Button, check if right clicked Pin
ABitSmart20-Sep-09 15:20
ABitSmart20-Sep-09 15:20 
GeneralRe: Command for Button, check if right clicked Pin
Gideon Engelberth21-Sep-09 3:30
Gideon Engelberth21-Sep-09 3:30 
GeneralRe: Command for Button, check if right clicked Pin
ABitSmart21-Sep-09 3:54
ABitSmart21-Sep-09 3:54 
QuestionCreating an image control in a seperated thread Pin
Haim Nachum19-Sep-09 15:54
Haim Nachum19-Sep-09 15:54 
Hi.
I have a wpf app that have a stack panel that i would like to populate
with images that i'm downloading from a website.

to avoid getting the UI from freezing while downloading the images i created another thread and in that thread downloaded the images and tried to create the image controls. but i'm getting this exception:
"The calling thread must be STA, because many UI components require this."

Here is the thread code:

<br />
  new Thread(delegate()<br />
            {<br />
                string searchUrl = siteAlgorithm.BuildSearchExpression(searchKeyWords);<br />
                searcherObj.Clear();<br />
                searcherObj.LoadNewPage(siteAlgorithm.ExtractSearchResults(myWebClient.DownloadSiteToString(searchUrl)));<br />
            <br />
                MemoryStream stream;<br />
                Image img = new Image(); // ---> Exception Thrown<br />
                System.Windows.Media.Imaging.BitmapImage bitImg;<br />
                foreach (SearchResult item in searcherObj.FirstPage.resultItems)<br />
                {<br />
                    stream = new MemoryStream(myWebClient.DownloadData(item.imageUrl));<br />
<br />
                    bitImg = new System.Windows.Media.Imaging.BitmapImage();<br />
                    bitImg.BeginInit();<br />
                    bitImg.StreamSource = stream;<br />
                    bitImg.EndInit();<br />
                    img.Source = bitImg;<br />
<br />
                    Gui.AddSearchResultItem(img, item.info, item.uri);<br />
                }<br />
            }<br />
            ).Start();<br />

AnswerRe: Creating an image control in a seperated thread Pin
Christian Graus19-Sep-09 16:57
protectorChristian Graus19-Sep-09 16:57 
QuestionUpdate multiple records with Ria services Pin
Nestea196919-Sep-09 8:59
Nestea196919-Sep-09 8:59 
QuestionHow do you change the background selection color for a WPF MenuItem? Pin
fjparisIII18-Sep-09 15:12
fjparisIII18-Sep-09 15:12 
AnswerRe: How do you change the background selection color for a WPF MenuItem? Pin
Talabér Ferenc13-Jan-10 23:35
Talabér Ferenc13-Jan-10 23:35 
QuestionWPF in VS 2008 Pin
schweras17-Sep-09 4:37
schweras17-Sep-09 4:37 
AnswerRe: WPF in VS 2008 Pin
Christian Graus17-Sep-09 14:24
protectorChristian Graus17-Sep-09 14:24 
QuestionForcing the Visual Tree to load Pin
DavidRen2317-Sep-09 3:35
DavidRen2317-Sep-09 3:35 
AnswerRe: Forcing the Visual Tree to load Pin
Pete O'Hanlon17-Sep-09 4:31
mvePete O'Hanlon17-Sep-09 4:31 
GeneralRe: Forcing the Visual Tree to load Pin
DavidRen2317-Sep-09 4:50
DavidRen2317-Sep-09 4:50 
QuestionHow to change canvas background color dynamically Pin
Nekkantidivya17-Sep-09 2:31
Nekkantidivya17-Sep-09 2:31 
AnswerRe: How to change canvas background color dynamically Pin
Pete O'Hanlon17-Sep-09 2:44
mvePete O'Hanlon17-Sep-09 2:44 
QuestionIs this message board a correct place to ask remoting and webservices related doubts? Pin
vishwjeet17-Sep-09 0:22
vishwjeet17-Sep-09 0:22 
AnswerRe: Is this message board a correct place to ask remoting and webservices related doubts? Pin
Pete O'Hanlon17-Sep-09 1:18
mvePete O'Hanlon17-Sep-09 1:18 
QuestionHow to display the silverlight page to display all the controls in it. Pin
Nekkantidivya16-Sep-09 20:02
Nekkantidivya16-Sep-09 20:02 
AnswerRe: How to display the silverlight page to display all the controls in it. Pin
Mark Salsbery23-Sep-09 5:45
Mark Salsbery23-Sep-09 5:45 
Questionhow can I programmatically set control colors using hex values ? Pin
abiemann16-Sep-09 7:58
abiemann16-Sep-09 7:58 
AnswerRe: how can I programmatically set control colors using hex values ? Pin
Christian Graus16-Sep-09 11:51
protectorChristian Graus16-Sep-09 11:51 

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.