示例#1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            // Constructor is too early for setting these properties.

            // The live sorting/grouping/filtering feature is a very expensive one so be careful to activate it only if needed
            // and only the one you actually need. It may be a good idea too to de-activate it when it’s no more needed.
            computersDataGrid.Items.IsLiveFiltering = true;
            foreach (string propertie in ObservableHost.GetLiveFilteringProperties())
            {
                computersDataGrid.Items.LiveFilteringProperties.Add(propertie);
            }

            projectsDataGrid.Items.IsLiveFiltering = true;
            foreach (string propertie in ObservableProject.GetLiveFilteringProperties())
            {
                projectsDataGrid.Items.LiveFilteringProperties.Add(propertie);
            }

            tasksDataGrid.Items.IsLiveFiltering = true;
            foreach (string propertie in ObservableTask.GetLiveFilteringProperties())
            {
                tasksDataGrid.Items.LiveFilteringProperties.Add(propertie);
            }

            transfersDataGrid.Items.IsLiveFiltering = true;
            foreach (string propertie in ObservableTransfer.GetLiveFilteringProperties())
            {
                transfersDataGrid.Items.LiveFilteringProperties.Add(propertie);
            }
        }
示例#2
0
        public HostDetailViewModel(ObservableHost host, INavigation navigation)
        {
            Title = host.Name;
            Host  = host;

            _navigation = navigation;

            RemoveHostCommand = new RelayCommand(async() => await ExecuteRemoveHostCommand(), CanExecuteRemoveHostCommand);
        }