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

WPF

 
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 
RantWPF - Why? Pin
SteveHolle17-Oct-14 6:20
SteveHolle17-Oct-14 6:20 
GeneralRe: WPF - Why? Pin
Gerry Schmitz17-Oct-14 11:07
mveGerry Schmitz17-Oct-14 11:07 
GeneralRe: WPF - Why? Pin
RedDk17-Oct-14 11:29
RedDk17-Oct-14 11:29 
GeneralRe: WPF - Why? Pin
SteveHolle6-Nov-14 4:18
SteveHolle6-Nov-14 4:18 
GeneralRe: WPF - Why? Pin
Mycroft Holmes17-Oct-14 13:51
professionalMycroft Holmes17-Oct-14 13:51 
GeneralRe: WPF - Why? Pin
SteveHolle6-Nov-14 4:22
SteveHolle6-Nov-14 4:22 
GeneralRe: WPF - Why? Pin
Mycroft Holmes6-Nov-14 11:36
professionalMycroft Holmes6-Nov-14 11:36 
GeneralRe: WPF - Why? Pin
Gary R. Wheeler8-Nov-14 3:12
Gary R. Wheeler8-Nov-14 3:12 
GeneralRe: WPF - Why? Pin
Pete O'Hanlon11-Nov-14 20:46
mvePete O'Hanlon11-Nov-14 20:46 
QuestionProblem to synchronise two DataContext bound ComboBoxes Pin
Tom Rahav10-Oct-14 18:25
Tom Rahav10-Oct-14 18:25 
AnswerRe: Problem to synchronise two DataContext bound ComboBoxes Pin
Gerry Schmitz13-Oct-14 11:39
mveGerry Schmitz13-Oct-14 11:39 
GeneralRe: Problem to synchronise two DataContext bound ComboBoxes Pin
Tom Rahav13-Oct-14 14:39
Tom Rahav13-Oct-14 14:39 
QuestionDataGrid won't detect CTRL + C Pin
Mc_Topaz9-Oct-14 3:17
Mc_Topaz9-Oct-14 3:17 
AnswerRe: DataGrid won't detect CTRL + C Pin
Vincent Beek9-Oct-14 15:23
Vincent Beek9-Oct-14 15:23 
QuestionRe: DataGrid won't detect CTRL + C Pin
Mc_Topaz9-Oct-14 20:08
Mc_Topaz9-Oct-14 20:08 
AnswerRe: DataGrid won't detect CTRL + C Pin
Vincent Beek9-Oct-14 20:25
Vincent Beek9-Oct-14 20:25 

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.