private void CCTVList_Loaded(object sender, RoutedEventArgs e) { var CCTVItem = CCTVListView.ContainerFromItem(CCTVSelectedItem) as ListViewItem; var ChildGrid = UIElementUtil.FindChild <Grid>(CCTVItem, "ChildGrid"); if (ChildGrid != null) { ChildGrid.BorderBrush = 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"); } }
private void LightDeivceListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { Debug.WriteLine("LightDeivceListView_SelectionChanged"); foreach (var item in e.RemovedItems) { var LightDeivceItem = LightDeivceListView.ContainerFromItem(item) as ListViewItem; var ChildGrid = UIElementUtil.FindChild <Grid>(LightDeivceItem, "ChildGrid"); if (ChildGrid != null) { ChildGrid.BorderBrush = new SolidColorBrush(Windows.UI.Colors.Transparent); } } foreach (var item in e.AddedItems) { var LightDeivceItem = LightDeivceListView.ContainerFromItem(item) as ListViewItem; var ChildGrid = UIElementUtil.FindChild <Grid>(LightDeivceItem, "ChildGrid"); if (ChildGrid != null) { ChildGrid.BorderBrush = new SolidColorBrush(Windows.UI.Colors.OrangeRed); } } }