/// <summary> /// Called when [navigated from]. /// </summary> /// <param name="navigationContext">The navigation context.</param> public override void OnNavigatedFrom(NavigationContext navigationContext) { TabItems.ForEach(x => { x.IsActive = false; }); }
/// <summary> /// Modifies the mapping reference. /// </summary> private void ModifyMappingReference() { ActiveTabItemIndex = 0; TabItems.ForEach(x => { x.IsActive = false; x.IsLoaded = false; }); RegionManager.RequestNavigate(Sdk.Regions.RegionNames.HospitalsMainRegion, new Uri(ViewNames.ContextView, UriKind.Relative)); }
/// <summary> /// Adiciona um separador de chat com todas as suas mensagens /// <para>Se o separador já existir não adiciona.</para> /// </summary> /// <param name="displayName">Nome a mostrar no título do separador</param> /// <param name="displayId">Id a mostrar no titulo do separador</param> /// <param name="idName">Id a colocar no Name (identificador) do separador</param> private void AddSeparadorChat(string displayName, string displayId, string idName) { string tabHeader = displayId == null ? displayName : $"{displayName} ({displayId})"; bool existeTabIgual = false; TabItems.ForEach(tab => { if ((string)tab.Header != tabHeader) { return; } existeTabIgual = true; }); if (existeTabIgual) { return; } ChatTabControl.DataContext = null; int count = TabItems.Count; TabItem novaTabItem = new TabItem { Header = tabHeader, Name = idName, HeaderTemplate = ChatTabControl.FindResource("TabHeader") as DataTemplate }; ScrollViewer chatScrollViewer = new ScrollViewer { Name = $"{idName}ScrollViewer" }; ItemsControl chatItemsControl = new ItemsControl(); StackPanel chatStackPanel = new StackPanel { Name = $"{idName}StackPanel" }; chatItemsControl.Items.Add(chatStackPanel); chatScrollViewer.Content = chatItemsControl; novaTabItem.Content = chatScrollViewer; TabItems.Insert(count, novaTabItem); ChatTabControl.DataContext = TabItems; ChatTabControl.SelectedItem = novaTabItem; if (idName == "id0") { return; } MainViewModel.ServerConnectService.EntrarChat(idName); }
/// <summary> /// Called when [navigated to]. /// </summary> /// <param name="navigationContext">The navigation context.</param> public override void OnNavigatedTo(NavigationContext navigationContext) { TabItems.ForEach(x => x.IsActive = false); }
/// <summary> /// Called when the implementer is being navigated away from. /// </summary> /// <param name="navigationContext">The navigation context.</param> public void OnNavigatedFrom(NavigationContext navigationContext) { TabItems.ForEach(x => x.IsActive = false); ActiveTabItemIndex = 0; }