Пример #1
0
        private void InitSelectedIndexChangedAction(IBaseView currentView, IBaseView nextView)
        {
            var filterProperty = BaseComplexView.GetFilterProperty(nextView as UIElement);
            var childViewModel = nextView.ViewModel;
            var headerFilter   = childViewModel.HeaderFilters.First(p => p.PropertyName == filterProperty);

            headerFilter.DisableChangedAction(p => { p.IsUsed = true; p.FilterValue = 0; });

            currentView.ViewModel.PropertyChanged += (sender, e) =>
            {
                OnSelectedIndexChanged(currentView, nextView, currentView.ViewModel.SelectedValue);
            };
        }
Пример #2
0
        protected virtual void OnSelectedIndexChanged(IBaseView currentView, IBaseView nextView, object selectedValue)
        {
            _logger.LogDebug("BaseComplexView OnSelectedIndexChanged {0}", currentView.GetType().Name);
            var viewModel      = currentView.ViewModel;
            var childViewModel = nextView.ViewModel;
            var filterProperty = BaseComplexView.GetFilterProperty(nextView as UIElement);
            var headerFilter   = childViewModel.HeaderFilters.First(p => p.PropertyName == filterProperty);

            childViewModel.ParentItem = viewModel.GetSelectedItem();
            if (selectedValue == null)
            {
                headerFilter.FilterValue = 0;
            }
            else
            {
                headerFilter.FilterValue = selectedValue;
            }
        }