public FileViewModel(DocumentModel _document) { Document = _document; NewCommand = new CommandClick(NewFile); OpenCommand = new CommandClick(OpenFile); SaveCommand = new CommandClick(SaveFile); SaveAsCommand = new CommandClick(SaveFileAs); ExitCommand = new CommandClick(ExitProgram); }
public MainViewModel() { this.Items = new ObservableCollection <ItemViewModel>(); client = new Service1Client(); user = new User(); Rejestracja = new CommandClick(RejestracjaCommand); Logowanie = new CommandClick(LogowanieCommand); client.RegisterCompleted += client_RegisterCompleted; client.LoginCompleted += client_LoginCompleted; client.GetUserNotesCompleted += client_GetUserNotesCompleted; }
private void commitInfo_CommandClicked(object sender, CommandEventArgs e) { CommandClick?.Invoke(sender, e); }
private void DoCommandClick(string command, string data) { CommandClick?.Invoke(this, new CommandEventArgs(command, data)); }
/// <summary></summary> protected Command AddNamedCommand(string name, string caption, int iconID, CommandClick onClick) { Command foundCommand = null; string fullName = AddInInstance.ProgID + "." + name; CommandEvent commandEvent; if (!_commands.TryGetValue(fullName, out commandEvent)) { foundCommand = ApplicationObject.Commands.AddNamedCommand(AddInInstance, name, caption, caption, true, iconID, null, (int)vsCommandStatus.vsCommandStatusSupported | (int)vsCommandStatus.vsCommandStatusEnabled); _commands.Add(fullName, new CommandEvent { Command = foundCommand, OnClick = onClick }); } return foundCommand; }
internal void RaiseCommandClick(CommandSpec spec) { CommandClick?.Invoke(spec); }