Ejemplo n.º 1
0
 private void OnExplorerPagePropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.HasPropertyChanged(nameof(ExplorerPage.IsActive)))
     {
         SendIsActivePageChanged();
     }
 }
Ejemplo n.º 2
0
 private void OnColorProviderPropertyChanged(object sender, PropertyChangedEventArgs e)
 {
     if (e.HasPropertyChanged("IsVisible"))
     {
         UpdateIsAllVisible();
     }
 }
        private void OnTextEditorControlPropertyChanged(object sender, PropertyChangedEventArgs args)
        {
#pragma warning disable WPF1014
            if (args.HasPropertyChanged(nameof(AssociatedObject.Scope)))
#pragma warning restore WPF1014
            {
                UpdateServiceRegistration();
            }
        }
Ejemplo n.º 4
0
        private void OnColorProviderPropertyChanged(object sender, PropertyChangedEventArgs e)
        {
#pragma warning disable WPF1014
            if (e.HasPropertyChanged(nameof(IColorLegendItem.IsChecked)))
#pragma warning restore WPF1014
            {
                UpdateIsAllVisible();
            }
        }
        protected override void OnViewModelPropertyChanged(PropertyChangedEventArgs e)
        {
            base.OnViewModelPropertyChanged(e);

            if (e.HasPropertyChanged(nameof(LogViewerViewModel.LogListenerType)))
            {
                UpdateControl();
            }
        }
Ejemplo n.º 6
0
        void ValidationInfo_PropertyChanged(object s, PropertyChangedEventArgs ea)
        {
            ValidationInfo vi = s as ValidationInfo;

            if (ea.HasPropertyChanged(() => vi.AggregateStatus))
            {
                Update();
            }
        }
        private void OnNuGetSettingsChanged(object sender, PropertyChangedEventArgs e)
        {
            if (!e.HasPropertyChanged(nameof(ExplorerSettingsContainer.IsHideInstalled)))
            {
                return;
            }

            if (Package.Status == PackageStatus.LastVersionInstalled || Package.Status == PackageStatus.UpdateAvailable)
            {
                Package.IsDelisted = _nugetSettings.IsHideInstalled;
            }
        }
Ejemplo n.º 8
0
 void _Source_PropertyChanged(object sender, PropertyChangedEventArgs ea)
 {
     if (ea != null)
     {
         foreach (PropertyInfo pi in _Properties)
         {
             if (ea.HasPropertyChanged(pi))
             {
                 _Wrapper.NotifyPropertyChanged(pi);
             }
         }
     }
 }
Ejemplo n.º 9
0
 void ValidationInfo_PropertyChanged(object sender, PropertyChangedEventArgs ea)
 {
     if (!IsValidating)
     {
         ValidationInfo vi = sender as ValidationInfo;
         if (vi != null)
         {
             if (ea.HasPropertyChanged(() => vi.ErrorMessage))
             {
                 NotifyPropertyChanged(() => ValidationInfo);
             }
         }
     }
 }
Ejemplo n.º 10
0
        protected override void OnViewModelPropertyChanged(PropertyChangedEventArgs e)
        {
            base.OnViewModelPropertyChanged(e);

            if (e.HasPropertyChanged(nameof(StepBarViewModel.SelectedItem)))
            {
                Dispatcher.BeginInvoke(async() =>
                {
                    stepbarListBox.CenterSelectedItem(Orientation);

                    // We need to await the animation
                    await TaskShim.Delay(StepBarConfiguration.AnimationDuration);
                });
            }
        }
Ejemplo n.º 11
0
        protected override void ValidationSource_PropertyChanged(object sender, PropertyChangedEventArgs ea)
        {
            if (ea.HasPropertyChanged(() => ValidationSource.IsValidating) && ValidationSource.IsValidating == false)
            {
                string message = string.Empty;

                List <ValidationStatus> aggregate = AggregateStatus;
                ValidationStatus        vs        = _Status.Matches(aggregate).Max();

                if (vs != ValidationStatus.None)
                {
                    if (_Dialog == null)
                    {
                        ValidatorDetail detail = new ValidatorDetail();

                        detail.SetBinding(ValidatorDetail.ValidationSourceProperty, new Binding()
                        {
                            Source = this, Path = this.GetPropertyPath(() => ValidationSource)
                        });
                        detail.SetBinding(ValidatorDetail.PropertyNameProperty, new Binding()
                        {
                            Source = this, Path = this.GetPropertyPath(() => PropertyName)
                        });
                        detail.SetBinding(ValidatorDetail.StatusProperty, new Binding()
                        {
                            Source = this, Path = this.GetPropertyPath(() => Status)
                        });

                        detail.Group = true;
                        detail.Max   = true;

                        _Dialog = new ValidatorDialog(detail);

                        _Dialog.Closing += (s, e) =>
                        {
                            _Dialog = null;
                        };

                        _Dialog.Owner = Window;
                        _Dialog.WindowStartupLocation = WindowStartupLocation.CenterOwner;

                        _Dialog.Show();
                    }
                }
            }
        }
        protected override void OnViewModelPropertyChanged(PropertyChangedEventArgs e)
        {
            base.OnViewModelPropertyChanged(e);

            if (e.HasPropertyChanged("CurrentPage"))
            {
                Dispatcher.BeginInvoke(async() =>
                {
                    var vm = (WizardViewModel)ViewModel;

                    breadcrumb.CenterSelectedItem();
                    breadcrumbProgress.UpdateProgress(vm.Wizard.CurrentPage.Number, vm.Wizard.Pages.Count());

                    // We need to await the animation
                    await TaskShim.Delay(WizardConfiguration.AnimationDuration);

                    UpdateOpacityMask();
                });
            }
        }
        protected override void OnViewModelPropertyChanged(PropertyChangedEventArgs e)
        {
            base.OnViewModelPropertyChanged(e);

#pragma warning disable WPF1014
            if (e.HasPropertyChanged("CurrentPage"))
#pragma warning restore WPF1014
            {
#pragma warning disable AvoidAsyncVoid
                Dispatcher.BeginInvoke(async() =>
                {
#pragma warning restore AvoidAsyncVoid
                    var vm = (FullScreenWizardViewModel)ViewModel;

                    breadcrumb.CenterSelectedItem();
                    breadcrumbProgress.UpdateProgress(vm.Wizard.CurrentPage.Number, vm.Wizard.Pages.Count());

                    // We need to await the animation
                    await TaskShim.Delay(WizardConfiguration.AnimationDuration);

                    UpdateOpacityMask();
                });
            }
        }
            public void ReturnsFalseForDifferentPropertyName()
            {
                var propertyChangedEventArgs = new PropertyChangedEventArgs("TestPropertyNotExisting");

                Assert.IsFalse(propertyChangedEventArgs.HasPropertyChanged(() => TestProperty));
            }
            public void ReturnsTrueForSamePropertyName()
            {
                var propertyChangedEventArgs = new PropertyChangedEventArgs("TestProperty");

                Assert.IsTrue(propertyChangedEventArgs.HasPropertyChanged(() => TestProperty));
            }
            public void ThrowsArgumentNullExceptionForNullPropertyExpressionArguments()
            {
                var propertyChangedEventArgs = new PropertyChangedEventArgs("TestProperty");

                ExceptionTester.CallMethodAndExpectException <ArgumentNullException>(() => propertyChangedEventArgs.HasPropertyChanged((Expression <Func <string> >)null));
            }