private void SettingPlugListView_ItemClick(object sender, ItemClickEventArgs e) { Debug.WriteLine("SettingPlugListView_ItemClick!!"); foreach (TextBlock tb in UIElementUtil.FindChildArray <TextBlock>(SettingDeviceListView, "CircleIcon")) { tb.Foreground = new SolidColorBrush(Windows.UI.Colors.DimGray); } ListView SettingPlugListView = sender as ListView; var item = e.ClickedItem; var PlugItem = SettingPlugListView.ContainerFromItem(item) as ListViewItem; foreach (TextBlock tb in UIElementUtil.FindChildArray <TextBlock>(PlugItem, "CircleIcon")) { tb.Foreground = ConverHexToColor.GetSolidColorBrush("#ffcb00"); } }
private void CustomName_GotFocus(object sender, RoutedEventArgs e) { Debug.WriteLine("CustomName_GotFocus!!"); foreach (TextBlock tb in UIElementUtil.FindChildArray <TextBlock>(SettingDeviceListView, "CircleIcon")) { tb.Foreground = new SolidColorBrush(Windows.UI.Colors.DimGray); } TextBox textBox = sender as TextBox; ZigBeeEndPoint endpoint = textBox.DataContext as ZigBeeEndPoint; ListView SettingPlugListView = UIElementUtil.FindParent <ListView>((TextBox)sender); var PlugItem = (ListViewItem)SettingPlugListView.ContainerFromItem(endpoint); foreach (TextBlock tb in UIElementUtil.FindChildArray <TextBlock>(PlugItem, "CircleIcon")) { tb.Foreground = ConverHexToColor.GetSolidColorBrush("#ffcb00"); } }
private async void HighLightSelectedItem(object Item) { if (Item == null) { return; } await Task.Delay(100); foreach (Grid gd in UIElementUtil.FindChildArray <Grid>(CCTVListView, "ChildGrid")) { gd.BorderBrush = new SolidColorBrush(Windows.UI.Colors.Transparent); } var CCTVItem = CCTVListView.ContainerFromItem(Item) as ListViewItem; var ChildGrid = UIElementUtil.FindChild <Grid>(CCTVItem, "ChildGrid"); if (ChildGrid != null) { ChildGrid.BorderBrush = ConverHexToColor.GetSolidColorBrush("#ffcb00"); } }