public void Startup(ViewStartupParams p) { publishModel = new PublishModel(p.AuthProvider, p.CustomNodeManager); publishViewModel = new PublishViewModel(publishModel); inviteModel = new InviteModel(p.AuthProvider); inviteModel.MessageLogged += this.OnMessageLogged; inviteViewModel = new InviteViewModel(inviteModel); }
/// <summary> /// Generates the invite menu item. /// </summary> /// <returns></returns> private MenuItem GenerateInviteMenuItem() { var item = new MenuItem(); item.Header = Resources.InviteViewMenuTitle; var isEnabled = startupParams.AuthProvider != null; item.IsEnabled = isEnabled; item.Click += (sender, args) => { var model = new InviteModel(startupParams.AuthProvider); model.MessageLogged += this.OnMessageLogged; var viewModel = new InviteViewModel(model); var view = new InviteView(viewModel) { Owner = loadedParams.DynamoWindow, WindowStartupLocation = WindowStartupLocation.CenterOwner }; view.ShowDialog(); model.MessageLogged -= this.OnMessageLogged; }; return item; }
public InviteView(InviteViewModel inviteViewModel) { InitializeComponent(); DataContext = inviteViewModel; }
public InviteView(InviteViewModel inviteViewModel) { InitializeComponent(); DataContext = inviteViewModel; Loaded += inviteViewModel.InviteLoad; }