/// <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); }
/// <summary> /// Generates the invite menu item. /// </summary> /// <returns></returns> private MenuItem GenerateInviteMenuItem() { MenuItem item = new MenuItem(); item.Header = Resources.InviteViewMenuTitle; var isEnabled = inviteModel.HasAuthProvider; item.IsEnabled = isEnabled; item.Click += (sender, args) => { InviteView inviteWindow = new InviteView(inviteViewModel); inviteWindow.ShowDialog(); }; return(item); }