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 9265417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:03:56+00:00 2026-06-18T14:03:56+00:00

I am just learning WPF so bear with me. I have a viewmodel with

  • 0

I am just learning WPF so bear with me.

I have a viewmodel with an observable collection of (very simplified here for brevity) Employee objects that looks something like this:

public class  Employee
{
  public string Name { get; set; }
  public string Title { get; set; }
}

In my C# WPF application, I am displaying information from this observable collection in a tab control in my view via simple data binding. Easy stuff so far. My requirement is that the user can dynamically add a new tab that displays only the information from the Employee that they are interested in and that new view of the Employee data will be saved and re-loaded each time the application is run.

So, let’s say my user wants a new tab added that only displays those employees that are Software Engineers. I need to give them a method to choose their filter criteria and then add a new tab to the tab control that shows the employees that match the selected filter criteria. That custom view of the employee information in the newly created tab should then be saved and recreated each time the application is run.

I don’t need full code examples, although that would really be helpful. What I would like is some suggestion for an approach so I can go google for information. I am just not sure which techniques are best to solve this problem. I am thinking dynamically created datatemplates or a custom CollectionViewSource, but then I need that information saved and reloaded so do I save the dynamically created datatemplate and use that when the application is loaded?

  • 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-06-18T14:03:56+00:00Added an answer on June 18, 2026 at 2:03 pm

    From what I understand, your tabs would each have a filter and an observable collection loaded based on this filter.

    If this is the case, one possible solution would be to define a view model to represent the tab (EmployeesViewModel). This view model will have properties for the filter and observable collection plus any other methods to save / modify the observable collection.

    public class EmployeesViewModel {
        public Filter Filter { get; set;}
        public ObservableCollection<Employee> Employees { get; set;}
        public Employee SelectedEmployee { get; set;}
        public RoutedCommand SaveSelectedEmployee { get; set;}
        …
    }
    

    Once you have this, make the class serializable (by implementing ISerializable). You should only serialize the filter conditions, not the content of the collection.

    When you shut down your application or when you teardown the tab viewer module, iterate through the tab collection, get the associated view model and serialize each of them. And when you start your application (or tab viewer module) recreate each tab using deserialized view model

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am very new to WPF. And just started learning threading. Here is my
I just start learning WPF, is that possible I can create an IE toolbar
Just learning WPF databinding and have a gap in my understanding. I've seen a
I am just learning WPF (and mvvm) , and I have encountered a problem
I've just started learning WPF and like the power of databinding it presents; that
I am just learning WPF and Caliburn.Micro. I am following the code that presented
I have just been learning about how styles and control templates in WPF can
just learning java and need to build a program that can store simple objects
I'm just learning WPF. I'm using VS 2008. I've added an Image control to
I've recently been learning the MVVM pattern in WPF and just started making my

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.