Exemplo n.º 1
0
        /// <summary>
        /// Shows the item in the view.
        /// </summary>
        /// <param name="viewModel">The view model to show.</param>
        private void ShowFriend(AddFriendViewModel viewModel)
        {
            WorkspaceWindow window = new WorkspaceWindow();

            window.Width  = 500;
            window.Height = 400;
            window.Title  = viewModel.DisplayName;

            viewModel.CloseAction = b => window.DialogResult = b;

            FriendView view = new FriendView();

            view.DataContext = viewModel;

            window.Content = view;
            window.ShowDialog();

            if (window.DialogResult == true)
            {
                this.Update();
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Opens the window to add a friend.
        /// </summary>
        private void AddNewFriend()
        {
            AddFriendViewModel viewModel = new AddFriendViewModel(this.account, this.repository);

            this.ShowFriend(viewModel);
        }