Ejemplo n.º 1
0
        private void RefreshAdapters()
        {
            if (refreshing)
            {
                return;
            }
            refreshing = true;

            if (_Adapters != null)
            {
                //Dispatcher.Invoke(() =>
                // {
                _Adapters.Refresh();
                //});
            }
            else
            {
                Dispatcher.Invoke(() =>
                {
                    _Adapters = new AdaptersCollection();
                });
            }

            Dispatcher.Invoke(() =>
            {
                this.AdapterList.ItemsSource = _Adapters.Adapters;

                ViewMenu = new VirtualMenu(this, this.AdapterList);
                this.netMenu.ItemsSource = ViewMenu;
            });

            refreshing = false;
        }
Ejemplo n.º 2
0
        public static void SetViewMenu(DependencyObject element, VirtualMenu value)
        {
            if (element is null)
            {
                throw new ArgumentNullException("element");
            }

            element.SetValue(ViewMenuProperty, value);
        }