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); }
public void SetUp() { authenticationProvider = new Mock<IAuthProvider>(); authenticationProvider.Setup(provider => provider.Username).Returns("DummyUserName"); // Create mock of reach client. var client = new Mock<IWorkspaceStorageClient>(); client.Setup(c => // If it's sent any workspace or any custom nodes, result always will be successful. c.Send(It.IsAny<HomeWorkspaceModel>(), It.IsAny<IEnumerable<CustomNodeWorkspaceModel>>())). Returns(Resource.WorkspacesSendSucceededServerResponse); // Create publish model. publishModel = new PublishModel(authenticationProvider.Object, CurrentDynamoModel.CustomNodeManager, client.Object); }
internal PublishViewModel(PublishModel model) { this.model = model; PublishCommand = new DelegateCommand(OnPublish); }
private void OnModelStateChanged(PublishModel.UploadState state) { IsUploading = state == PublishModel.UploadState.Uploading; BeginInvoke(() => PublishCommand.RaiseCanExecuteChanged()); }
internal PublishViewModel(PublishModel model) { this.model = model; PublishCommand = new DelegateCommand(OnPublish, CanPublish); model.UploadStateChanged += OnModelStateChanged; }
private MenuItem GenerateMenuItem() { var item = new MenuItem(); item.Header = Resources.DynamoViewMenuItemPublishTitle; var isEnabled = loadedParams.CurrentWorkspaceModel is HomeWorkspaceModel && startupParams.AuthProvider != null; item.IsEnabled = isEnabled; item.Click += (sender, args) => { var model = new PublishModel(startupParams.AuthProvider, startupParams.CustomNodeManager); model.MessageLogged += this.OnMessageLogged; var viewModel = new PublishViewModel(model) { CurrentWorkspaceModel = loadedParams.CurrentWorkspaceModel }; var window = new PublishView(viewModel) { Owner = loadedParams.DynamoWindow, WindowStartupLocation = WindowStartupLocation.CenterOwner }; window.ShowDialog(); model.MessageLogged -= this.OnMessageLogged; }; return item; }
public void Startup(ViewStartupParams p) { publishModel = new PublishModel(p.AuthProvider, p.CustomNodeManager); publishViewModel = new PublishViewModel(publishModel); }
private void OnModelStateChanged(PublishModel.UploadState state) { IsUploading = state == PublishModel.UploadState.Uploading; firstTimeErrorMessage = state == PublishModel.UploadState.Failed; BeginInvoke(() => PublishCommand.RaiseCanExecuteChanged()); }
internal PublishViewModel(PublishModel model) { this.model = model; PublishCommand = new DelegateCommand(OnPublish, CanPublish); VisitCommand = new DelegateCommand(Visit, CanVisit); CopyLinkCommand = new DelegateCommand(CopyLink, CanCopyLink); model.UploadStateChanged += OnModelStateChanged; model.CustomizerURLChanged += OnCustomizerURLChanged; }