public ContactListViewModel(VSTalkCore core) { _core = core; SetCommands(); FillContactList(); }
public AddContactWindow(VSTalkCore core, Client client = null) { InitializeComponent(); DataContext = this; _core = core; Clients = new ObservableCollection<Client>(core.AvailableClients); SelectedClient = client ?? Clients.FirstOrDefault(); SetCommands(); }
public MainViewModel(VSTalkCore core) { _core = core; ContactList = new ContactListViewModel(core); NotificationView = new NotificationViewModel(core.NotificationQueue); SetHandlers(); SetCommands(); }
public ChatFrameViewModel(VSTalkCore core) { _core = core; SetCommands(); ViewContacts = new ObservableCollection<InterlocutorChatViewModel>(); this.SubscribeToChange(() => SelectedInterlocutor, param => { if (SelectedInterlocutor != null) { SelectedInterlocutor.Interlocutor.HasUnreadMessages = false; } }); }
/// <summary> /// Initialization of the package; this method is called right after the package is sited, so this is the place /// where you can put all the initilaization code that rely on services provided by VisualStudio. /// </summary> protected override void Initialize() { Trace.WriteLine (string.Format(CultureInfo.CurrentCulture, "Entering Initialize() of: {0}", this.ToString())); base.Initialize(); VSTalkCore = new VSTalkCore( InitilizeWindowManager(), InitilizeEnvironmentManager(), InitializeModelContext()); // Add our command handlers for menu (commands must exist in the .vsct file) OleMenuCommandService mcs = GetService(typeof(IMenuCommandService)) as OleMenuCommandService; if ( null != mcs ) { // Create the command for the menu item. CommandID menuCommandID = new CommandID(GuidList.guidVSTalkCmdSet, (int)PkgCmdIDList.cmdidVSTalk); MenuCommand menuItem = new MenuCommand(ShowToolWindow, menuCommandID); mcs.AddCommand( menuItem ); // Create the command for the tool window CommandID toolwndCommandID = new CommandID(GuidList.guidVSTalkCmdSet, (int)PkgCmdIDList.cmdidBaseToolWindow); MenuCommand menuToolWin = new MenuCommand(ShowToolWindow, toolwndCommandID); mcs.AddCommand( menuToolWin ); } }