Click here to Skip to main content
15,910,224 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Project Output Type Class Library and Windows Application Pin
Ashfaque Hussain3-Nov-14 0:28
Ashfaque Hussain3-Nov-14 0:28 
GeneralRe: Project Output Type Class Library and Windows Application Pin
Pete O'Hanlon3-Nov-14 0:43
mvePete O'Hanlon3-Nov-14 0:43 
GeneralRe: Project Output Type Class Library and Windows Application Pin
Ashfaque Hussain3-Nov-14 0:57
Ashfaque Hussain3-Nov-14 0:57 
GeneralRe: Project Output Type Class Library and Windows Application Pin
Pete O'Hanlon3-Nov-14 1:30
mvePete O'Hanlon3-Nov-14 1:30 
GeneralRe: Project Output Type Class Library and Windows Application Pin
Ashfaque Hussain3-Nov-14 1:57
Ashfaque Hussain3-Nov-14 1:57 
GeneralRe: Project Output Type Class Library and Windows Application Pin
cjb11019-Nov-14 23:55
cjb11019-Nov-14 23:55 
GeneralRe: Project Output Type Class Library and Windows Application Pin
Ashfaque Hussain20-Nov-14 0:05
Ashfaque Hussain20-Nov-14 0:05 
GeneralRe: Project Output Type Class Library and Windows Application Pin
cjb11020-Nov-14 0:43
cjb11020-Nov-14 0:43 
GeneralRe: Project Output Type Class Library and Windows Application Pin
Ashfaque Hussain20-Nov-14 1:11
Ashfaque Hussain20-Nov-14 1:11 
GeneralRe: Project Output Type Class Library and Windows Application Pin
cjb11020-Nov-14 3:06
cjb11020-Nov-14 3:06 
QuestionAdd a table to a DockPanel Pin
zhshqzyc31-Oct-14 8:56
zhshqzyc31-Oct-14 8:56 
AnswerRe: Add a table to a DockPanel Pin
Mycroft Holmes31-Oct-14 13:44
professionalMycroft Holmes31-Oct-14 13:44 
GeneralRe: Add a table to a DockPanel Pin
zhshqzyc31-Oct-14 15:51
zhshqzyc31-Oct-14 15:51 
GeneralRe: Add a table to a DockPanel Pin
Mycroft Holmes2-Nov-14 21:07
professionalMycroft Holmes2-Nov-14 21:07 
QuestionProblem connection database Silverlight project Pin
Hi I am Kevin29-Oct-14 5:55
Hi I am Kevin29-Oct-14 5:55 
AnswerRe: Problem connection database Silverlight project Pin
Mycroft Holmes31-Oct-14 13:38
professionalMycroft Holmes31-Oct-14 13:38 
QuestionWPF Navigation system Pin
Hi-I-am-Tang29-Oct-14 4:58
Hi-I-am-Tang29-Oct-14 4:58 
AnswerRe: DataTransferManager RT Only? Pin
Richard Deeming27-Oct-14 11:56
mveRichard Deeming27-Oct-14 11:56 
GeneralRe: DataTransferManager RT Only? Pin
Richard Deeming28-Oct-14 4:14
mveRichard Deeming28-Oct-14 4:14 
GeneralRe: DataTransferManager RT Only? Pin
Richard Deeming28-Oct-14 7:34
mveRichard Deeming28-Oct-14 7:34 
GeneralRe: DataTransferManager RT Only? Pin
Richard Deeming28-Oct-14 8:42
mveRichard Deeming28-Oct-14 8:42 
QuestionWPF MVVM VALIDATION Pin
Arun Karuvatta23-Oct-14 22:08
professionalArun Karuvatta23-Oct-14 22:08 
AnswerRe: WPF MVVM VALIDATION Pin
Pete O'Hanlon23-Oct-14 22:42
mvePete O'Hanlon23-Oct-14 22:42 
QuestionWPF or MVC 4 Problem? Pin
Kevin Marois18-Oct-14 17:38
professionalKevin Marois18-Oct-14 17:38 
I am working on a WPF 4.0 app that calls to the back end via an MVC 4 Web API.

I have a view called Injuries. I have an InjuryEntity which contains an ObservableCollection of DocumentEntity.

I'm using an ObservableCollection because the WPF UI is bound as such:

<DataGrid Grid.Row="1"
            Grid.Column="0"
            Background="White"
            ItemsSource="{Binding SelectedInjury.Documents}" 
            SelectedItem="{Binding SelectedDocument}"
            AutoGenerateColumns="False"
            FontSize="12"
            FontWeight="Normal"
            FontStyle="Normal"
            IsReadOnly="True"
            TabIndex="1200"
            Height="130"
            Margin="3">


When I call
InjuryEntity.Documents.Add()


everything works fine. I am able to save the data to the DB with no problem.

Now, when I call back into the API to get the Injuries, I get back null. The ENTIRE Injury entity is null, not just the documents.

If I make the ObservableCollection into List<>, then the data comes back fine.

I'm using ObservableCollection because in injury entity's Documents collection makes use of the Collection_Changed event so that I can do:

Documents = new List<InjuryDocumentsEntity>();
Documents.CollectionChanged += Documents_CollectionChanged;

private void Documents_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
    RaisePropertyChanged("Documents");
}


This allows the data grid and other UI elements the be refreshed as soon as a collection item changes.


So, the problem appears to be that MVC 4 doesn't like ObservableCollection.

I've been Googling, but I'm not finding much help.

Can anyone shed some light on this?

Thanks
If it's not broken, fix it until it is

AnswerRe: WPF or MVC 4 Problem? Pin
Richard Deeming20-Oct-14 1:51
mveRichard Deeming20-Oct-14 1: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.