Click here to Skip to main content
15,887,214 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: WPF/MVVM Unit Test Questions Pin
Mycroft Holmes7-Jan-16 12:03
professionalMycroft Holmes7-Jan-16 12:03 
GeneralRe: WPF/MVVM Unit Test Questions Pin
Pete O'Hanlon7-Jan-16 21:37
mvePete O'Hanlon7-Jan-16 21:37 
Questionwhat is the best way to save images to print in wpf Pin
neodeaths5-Jan-16 4:12
neodeaths5-Jan-16 4:12 
QuestionAdding icons to a ListView from an image list Pin
zahalul28-Dec-15 11:09
zahalul28-Dec-15 11:09 
AnswerRe: Adding icons to a ListView from an image list Pin
Richard Andrew x6428-Dec-15 14:39
professionalRichard Andrew x6428-Dec-15 14:39 
AnswerRe: Adding icons to a ListView from an image list Pin
Richard MacCutchan28-Dec-15 22:19
mveRichard MacCutchan28-Dec-15 22:19 
GeneralRe: Adding icons to a ListView from an image list Pin
zahalul30-Dec-15 9:17
zahalul30-Dec-15 9:17 
QuestionPassing Information to the Code behind Pin
Mycroft Holmes20-Dec-15 22:26
professionalMycroft Holmes20-Dec-15 22:26 
I know that is an aberration but I am building a TreeListView where the Tree Column [0] is fixed and the following columns are dynamically created as a collection of columns in the viewmodel. The code behind then adds the columns to the TreeListView when they are built.

The creation of the columns is done on a BGW and a message is generated for the code behind to consume in the BGW complete method.

However the Message is complaining that it is on the wrong thread.

VM BGW Complete Method
C#
private void NavComplete(object sender, RunWorkerCompletedEventArgs e)
{
    worker.DoWork -= LoadTreeStuff; ;
    worker.RunWorkerCompleted -= NavComplete; ;
    if (e.Result != null)
    {
        MessageBox.Show(e.Result.ToString());
    }
    BusyIndicator = false;
    AppMessages.MessageObject.Send("ColumnsReady");
}

I would have thought the AppMessage.MessageObject.Send would be on the main application thread.
C#
public static class MessageObject
    {
        public static void Send(object oPayload)
        {
            Messenger.Default.Send<object>(oPayload);<-------Errors
        }

<pre>
    public static void Register(object recipient, Action&lt;object&gt; action)
    {
        Messenger.Default.Register&lt;object&gt;(recipient, action);
    }

    public static void UnRegister(object recipient)
    {
        Messenger.Default.Unregister&lt;object&gt;(recipient);
    }
}</pre>

with the following error
Quote:
The calling thread cannot access this object because a different thread owns it.


Any suggestions other than getting rid of the BGW (works perfection when it is removed)
Never underestimate the power of human stupidity
RAH

AnswerRe: Passing Information to the Code behind Pin
Pete O'Hanlon20-Dec-15 23:21
mvePete O'Hanlon20-Dec-15 23:21 
QuestionWhy do I need a connection string to use an Entity Framework data model? Pin
_T_C_20-Dec-15 7:23
_T_C_20-Dec-15 7:23 
RantRe: Why do I need a connection string to use an Entity Framework data model? Pin
Mycroft Holmes20-Dec-15 12:14
professionalMycroft Holmes20-Dec-15 12:14 
GeneralRe: Why do I need a connection string to use an Entity Framework data model? Pin
_T_C_20-Dec-15 13:04
_T_C_20-Dec-15 13:04 
GeneralRe: Why do I need a connection string to use an Entity Framework data model? Pin
Mycroft Holmes20-Dec-15 19:23
professionalMycroft Holmes20-Dec-15 19:23 
AnswerRe: Why do I need a connection string to use an Entity Framework data model? Pin
Gerry Schmitz20-Dec-15 18:07
mveGerry Schmitz20-Dec-15 18:07 
AnswerRe: Why do I need a connection string to use an Entity Framework data model? Pin
_T_C_21-Dec-15 7:18
_T_C_21-Dec-15 7:18 
GeneralRe: Why do I need a connection string to use an Entity Framework data model? Pin
Gerry Schmitz23-Dec-15 11:29
mveGerry Schmitz23-Dec-15 11:29 
QuestionHow do I bind based on the value selected in a list box? Pin
_T_C_19-Dec-15 15:45
_T_C_19-Dec-15 15:45 
AnswerRe: How do I bind based on the value selected in a list box? Pin
_T_C_19-Dec-15 17:59
_T_C_19-Dec-15 17:59 
SuggestionRe: How do I bind based on the value selected in a list box? Pin
Richard Deeming4-Jan-16 3:55
mveRichard Deeming4-Jan-16 3:55 
QuestionRequest for help with simple WPF Pin
_T_C_18-Dec-15 11:14
_T_C_18-Dec-15 11:14 
AnswerRe: Request for help with simple WPF Pin
Gerry Schmitz18-Dec-15 11:34
mveGerry Schmitz18-Dec-15 11:34 
GeneralRe: Request for help with simple WPF Pin
_T_C_18-Dec-15 11:53
_T_C_18-Dec-15 11:53 
GeneralRe: Request for help with simple WPF Pin
Gerry Schmitz18-Dec-15 12:08
mveGerry Schmitz18-Dec-15 12:08 
GeneralRe: Request for help with simple WPF Pin
_T_C_18-Dec-15 12:42
_T_C_18-Dec-15 12:42 
GeneralRe: Request for help with simple WPF Pin
Gerry Schmitz18-Dec-15 12:57
mveGerry Schmitz18-Dec-15 12:57 

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.