public void RemoveItems(SideItem item) { App.Current.Dispatcher.BeginInvoke((Action) delegate() { SideItems.Remove(item); ChatVMFactory.DeleteViewModel(item.RoomName); }); }
public SideItem(ObservableCollection <User> users, string serverName, string initial) { //Test2Command = new RelayParameterCommand(async (parameter) => await go2(parameter)); Test2Command = new RelayCommand(async() => await GoToChatPage()); ChatList = new ObservableCollection <ChatItem>(); UserList = users; RoomName = serverName; Initial = initial; ChatVMFactory.PushViewModel(RoomName, new ChatPageVM(RoomName, ChatList, UserList, this)); pageVM = ChatVMFactory.GetViewModel(RoomName); }