public void Init()
 {
     log.Info(nameof(Init));
     this.viewModel = new ContactBookViewModel();
     this.viewModel.Init();
     this.DataContext             = viewModel;
     this.dataGrid.ItemsSource    = viewModel.Book;
     dataGrid.MouseRightButtonUp += new MouseButtonEventHandler(Book_MouseRightButtonUp);
 }
        public MainWindow()
        {
            var dataService   = new DataService();
            var dialogService = new DialogService();
            var signupVM      = new SignupViewModel(dataService, dialogService);
            var loginVM       = new LoginViewModel(dataService, dialogService);
            var contactbookVM = new ContactBookViewModel(dataService, dialogService);
            var appVM         = new AppViewModel(signupVM, loginVM, contactbookVM);

            DataContext = appVM;
            InitializeComponent();
        }