private void SwapTextColorToDark() { DGTextBlocks = VisualTreeSearch.SearchChildren(WorkingAdaptersDG, typeof(TextBlock)); TitleTB.BeginStoryboard((Storyboard)TryFindResource("ForegroundColorToBlackST")); for (int i = 0; i < (WorkingAdaptersDG).Columns.Count; i++) { (DGTextBlocks[i] as TextBlock).Foreground = new SolidColorBrush(((DGTextBlocks[i] as TextBlock).Foreground as SolidColorBrush).Color); (DGTextBlocks[i] as TextBlock).BeginStoryboard((Storyboard)TryFindResource("ForegroundColorToBlackST")); } for (int i = (WorkingAdaptersDG).Columns.Count; i < DGTextBlocks.Count; i++) { (DGTextBlocks[i] as TextBlock).Foreground = new SolidColorBrush(((DGTextBlocks[i] as TextBlock).Foreground as SolidColorBrush).Color); (DGTextBlocks[i] as TextBlock).BeginStoryboard((Storyboard)TryFindResource("ForegroundColorToInactiveST")); } for (int i = (WorkingAdaptersDG).Columns.Count; i < DGTextBlocks.Count; i++) { (DGTextBlocks[i] as TextBlock).MouseDown -= CopyMouseDown_e; } }
private void SwapTextColorToBase() { DGTextBlocks = VisualTreeSearch.SearchChildren(DisabledAdaptersDG, typeof(TextBlock)); TitleTB.BeginStoryboard((Storyboard)TryFindResource("ForegroundColorToActiveST")); for (int i = 0; i < (DisabledAdaptersDG).Columns.Count; i++) { (DGTextBlocks[i] as TextBlock).Foreground = new SolidColorBrush(((DGTextBlocks[i] as TextBlock).Foreground as SolidColorBrush).Color); (DGTextBlocks[i] as TextBlock).BeginStoryboard((Storyboard)TryFindResource("ForegroundColorToActiveST")); } for (int i = (DisabledAdaptersDG).Columns.Count; i < DGTextBlocks.Count; i++) { (DGTextBlocks[i] as TextBlock).Foreground = new SolidColorBrush(((DGTextBlocks[i] as TextBlock).Foreground as SolidColorBrush).Color); (DGTextBlocks[i] as TextBlock).BeginStoryboard((Storyboard)TryFindResource("ForegroundColorToActiveST")); } if (DGTextBlocks != null) { for (int i = (DisabledAdaptersDG).Columns.Count; i < DGTextBlocks.Count; i++) { (DGTextBlocks[i] as TextBlock).MouseDown += CopyMouseDown_e; } } }