Exemple #1
0
        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 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");
            }
        }
Exemple #4
0
        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");
            }
        }
Exemple #5
0
        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);
                }
            }
        }