protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); string uriParam = ""; if (NavigationContext.QueryString.TryGetValue("chatId", out uriParam)) { model = TelegramSession.Instance.GetChat(int.Parse(uriParam)); } else { logger.error("Unable to get model id from navigation"); } UpdateDataContext(); }
public void SaveChat(Chat chat) { ChatModel model = new ChatModel(chat); if (chats.ContainsKey(model.Id)) { Deployment.Current.Dispatcher.BeginInvoke(delegate { chats[model.Id].SetChat(chat); }); } else { chats[model.Id] = model; } }