Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4015460
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T09:37:18+00:00 2026-05-20T09:37:18+00:00

I’m trying to produce an error list much like the one in Visual Studio.

  • 0

I’m trying to produce an error list much like the one in Visual Studio.

I have a view and the view model. I update the singleton view model and notify that changes have occurred to the property which are the actual messages (errors and warnings). However, the grid remains unchanged – what is wrong?!

I have stepped through, the collection _messages is updated correctly and an initial message is shown correctly but remain in view after the view model update. In other words it should be a matter of making the view update according to a correct view model.

I am aware of the bug in RadPane that causes Panes to loose it’s connection to view model and have implemented the standard workaround.

The view model implements INotifyPropertyChanged.

(The NotifySourceUpdated in xaml added in an attempt to remedy, but to no avail)

(Brackets replaced in View due to Stackoverflow restrictions)

Thanks for any input and insight…

Anders, Denmark

View:

    [Controls:RadPane x:Class="Rap1D.Rap1D_WPF.Views.ErrorListView"
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:Controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking" xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" mc:Ignorable="d" 
                 d:DesignHeight="74" d:DesignWidth="298" Header="{Binding Header}" DataContextChanged="RadPane_DataContextChanged"]
        [Grid]
            [telerik:RadGridView AutoGenerateColumns="False" x:Name="grid" ItemsSource="{Binding Path=Messages, NotifyOnSourceUpdated=True}" Margin="0,0,0,37"]
                [telerik:RadGridView.Columns]
                    [telerik:GridViewDataColumn Header="Message" DataMemberBinding="{Binding Path=Message, NotifyOnSourceUpdated=True}" /]
                [/telerik:RadGridView.Columns]
            [/telerik:RadGridView]
        [/Grid]
    [/Controls:RadPane]

ViewModel:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using Rap1D.ViewModelLayer.Interfaces;
    using Rap1D.ViewModelLayer.Interfaces.TreeViewItems;

    namespace Rap1D.ViewModelLayer.Implementations
    {
        public class ErrorListViewModel :ViewModelBase, IErrorListViewModel
        {
            private readonly List<INotificationMessage> _messages;

            public ErrorListViewModel()
            {
                _messages = new List<INotificationMessage>();
            }

            public string Header
            {
                get { return "Error List"; }
            }

            public IEnumerable<INotificationMessage> Messages
            {
                get { return _messages; }
            }

            public void RemoveNotificationsForItem(IProductComponentViewModel productComponentViewModel)
            {
                var toDelete = (from m in _messages 
                                where m.Item == productComponentViewModel 
                                select m).ToList();
                foreach (var notificationMessage in toDelete)
                {
                    _messages.Remove(notificationMessage);
                }
                OnPropertyChanged("Messages");
            }

            public void AddNotifications(IProductComponentViewModel productComponentViewModel, IEnumerable<INotificationMessage> list)
            {
                _messages.AddRange(list);
                OnPropertyChanged("Messages");
            }
        }
    }

ErrorManager:

    using System.Collections.Generic;
    using Rap1D.ViewModelLayer.Interfaces;
    using Rap1D.ViewModelLayer.Interfaces.Managers;
    using Rap1D.ViewModelLayer.Interfaces.Providers;
    using Rap1D.ViewModelLayer.Interfaces.TreeViewItems;

    namespace Rap1D.ViewModelLayer.Implementations.Managers
    {
        public class ErrorManager : IErrorManager
        {
            private readonly IErrorListViewModelProvider _errorListViewModelProvider;

            public ErrorManager(IErrorListViewModelProvider errorListViewModelProvider)
            {
                _errorListViewModelProvider = errorListViewModelProvider;
            }

            public void UpdateNotificationsForItem(IProductComponentViewModel productComponentViewModel,
                                                   IEnumerable<INotificationMessage> list)
            {
                var errorListViewModel = _errorListViewModelProvider.GetViewModel();

                errorListViewModel.RemoveNotificationsForItem(productComponentViewModel);
                errorListViewModel.AddNotifications(productComponentViewModel, list);
            }
        }
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T09:37:19+00:00Added an answer on May 20, 2026 at 9:37 am

    All it took was changing to List to ObservableCollection.

    Can someone explain why my initial solution didn’t work as expected?

        using System.Collections.Generic;
        using System.Collections.ObjectModel;
        using System.Linq;
        using Microsoft.Practices.Prism;
        using Rap1D.ViewModelLayer.Interfaces;
        using Rap1D.ViewModelLayer.Interfaces.TreeViewItems;
    
        namespace Rap1D.ViewModelLayer.Implementations
        {
            public class ErrorListViewModel : ViewModelBase, IErrorListViewModel
            {
                private readonly ObservableCollection<INotificationMessage> _messages;
    
                public ErrorListViewModel()
                {
                    _messages = new ObservableCollection<INotificationMessage>();
                }
    
                public string Header
                {
                    get { return "Error List"; }
                }
    
                public void AddNotifications(IProductComponentViewModel productComponentViewModel,
                                             IEnumerable<INotificationMessage> list)
                {
                    _messages.AddRange(list);
                    OnPropertyChanged("Messages");
                }
    
                public IEnumerable<INotificationMessage> Messages
                {
                    get { return _messages; }
                }
    
                public void RemoveNotificationsForItem(IProductComponentViewModel productComponentViewModel)
                {
                    var toDelete = (from m in _messages
                                    //where m.Item == productComponentViewModel 
                                    select m).ToList();
                    foreach (var notificationMessage in toDelete)
                    {
                        _messages.Remove(notificationMessage);
                    }
                    OnPropertyChanged("Messages");
                }
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to loop through a bunch of documents I have to put
I have some data like this: 1 2 3 4 5 9 2 6
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
this is what i have right now Drawing an RSS feed into the php,
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I have a bunch of posts stored in text files formatted in yaml/textile (from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.