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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:55:47+00:00 2026-06-11T19:55:47+00:00

I am into this wpf from last 2 weeks. I am currently developing a

  • 0

I am into this wpf from last 2 weeks. I am currently developing a wpf application based on MVVM pattern. I have 2 projects inside my Solution in Visual C# 2010. One is a WPF application(lets say MSPBoardControl) and other is a Class Library(lets say ConnectViewComponent). Thus both the MSPBoardControl and ConnectViewComponent have the view, viewmodel, model classes respectively.

I have added the reference of ConnectViewComponent in my MSPBoardControl and I am able to access the member variables of ConnectViewComponent in my MSPBoardControl’s View,Viewmodel and model class. My concern is how to access the member variables of MSPBoardControl from my ConnectViewComponent.

ViewModel of MSPBoardControl:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using ConnectViewComponent.Model;
using System.Windows.Input;
using ConnectViewComponent.Commands;
[[[using MSPBoardControl.ViewModel;]]]

namespace ConnectViewComponent.ViewModel
{
public class ConnectViewModel : INotifyPropertyChanged
{
    public List<ConnectModel> m_BoardNames;
    [[[BoardControlViewModel mBoardVM;]]]

    public ConnectViewModel()
    {
        m_BoardNames = new List<ConnectModel>()
        {                
            new ConnectModel() {Name = "Bavaria", Connection_Status = "Disconnected"},
            new ConnectModel() {Name = "Redhook", Connection_Status = "Disconnected"},                
        };
    }

    public List<ConnectModel> BoardNames
    {
        //get set
    }

    private ConnectModel m_SelectedBoardItem;
    public ConnectModel SelectedBoard
    {
        //get set
    }

    private ICommand mUpdater;
    public ICommand ConnectCommand
    {
        get
        {
            if (mUpdater == null)
                mUpdater = new DelegateCommand(new Action(SaveExecuted), new Func<bool>(SaveCanExecute));

            return mUpdater;
        }
        set
        {
            mUpdater = value;
        }
    }

    public bool SaveCanExecute()
    {
        return true;
    }

    public void SaveExecuted()
    {
        if (SelectedBoard.Connection_Status == "Disconnected" && SelectedBoard.Name == "Bavaria")
        {
            SelectedBoard.Connection_Status = "Connected";                
        }

        else if (SelectedBoard.Connection_Status == "Disconnected" && SelectedBoard.Name == "Redhook")
        {
            SelectedBoard.Connection_Status = "Connected";               
        }
    }
}
}

[[[ — ]]] in my code denotes I am not able to access the members of BoardControlViewModel as well as USING Namespace.ViewModel too.

I cannot add the reference of BoardControl in my ConnectComponent project since it will lead to circular dependency. How can I access it? Please Help!!

  • 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-11T19:55:48+00:00Added an answer on June 11, 2026 at 7:55 pm

    Having circular dependencies in your project can be a “code smell”. There are various ways to remove this “smell”. For simplicity lets say that you have project A and project B that has a circular dependency.

    1. Factor out the common types used by both projects and move them into a new project C. Let A and B reference C. This should remove either the dependency from A to B or the opposite dependency or even both dependencies.

    2. If A and B has types that need to interact you need to decouple this interaction into a common set of abstractions (e.g. interfaces or abstract base classes). You should then move these types without any implementation into project C that both A and B references. This will allow the types in A and B to interact but only using the definitions in C. An example could be that A is the main application. It calls in interface IService defined in C but implemented in B and registers a callback IServiceCallback defined in C via IService. B can then call back into A using IServiceCallback without knowing that the implementation is in A.

    3. If the types in A and B are strongly coupled you should merge A and B into a single project.

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

Sidebar

Related Questions

I have a datagrid in a WPF populated from a csv file. This is
I'm a .Net developer moving from Winforms to WPF and have run into a
I am only two weeks into WPF so this is probably a trivial question.
I'm having trouble pasting from a csv into the wpf datagrid - I have
I ran into this interesting issue today. I have a button on a wpf
I defined a Window in WPF, into this one I put a stack panel
I'm just diving into WPF and find this a little odd and frustrating to
from this (normal dataGrid) (source: narod.ru ) into this (horisontal data grid) How to
I run into this problem. I have a textarea which I only want to
I am attempting to get the data from a wpf password box into a

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.