I'm working on a personal finance application in WPF. I have my MainWindow which obviously handles the rendering. My question is, how do I elegantly access an object in the App class? My structure is set up like this:
class Application { }
class App : Application {
private AccountManager accountManager; // HOW DO I ELEGANTLY ACCESS THIS IN MAINWINDOW?
// USE SINGLETON PATTERN?
}
class MainWindow { }
class AccountManager {
List<Account> accounts = new List<Account>();
}
static class AccountFactory {
static Account CreateFactory(string Account);
}
class Account { }
class Asset : Account { }
class Equity : Account { }
class Expense : Account { }
class Income : Account { }
class Liability : Account { }