public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Visibility wizardVisibility = (Visibility)values[0];
            WizardPageButtonVisibility wizardPageVisibility = ((values[1] == null) || (values[1] == DependencyProperty.UnsetValue))
                                                                                                                          ? WizardPageButtonVisibility.Hidden
                                                                                                                          : (WizardPageButtonVisibility)values[1];

            Visibility visibility = Visibility.Visible;

            switch (wizardPageVisibility)
            {
            case WizardPageButtonVisibility.Inherit:
                visibility = wizardVisibility;
                break;

            case WizardPageButtonVisibility.Collapsed:
                visibility = Visibility.Collapsed;
                break;

            case WizardPageButtonVisibility.Hidden:
                visibility = Visibility.Hidden;
                break;

            case WizardPageButtonVisibility.Visible:
                visibility = Visibility.Visible;
                break;
            }

            return(visibility);
        }
        public object Convert(object[] values, Type targetType, object parameter,
                              System.Globalization.CultureInfo culture)
        {
            if (values == null || values.Length != 2)
            {
                throw new ArgumentException("Wrong number of arguments for WizardPageButtonVisibilityConverter.");
            }

            Visibility wizardVisibility = ((values[0] == null) || (values[0] == DependencyProperty.UnsetValue))
                ? Visibility.Hidden
                : (Visibility)values[0];

            WizardPageButtonVisibility wizardPageVisibility = ((values[1] == null) ||
                                                               (values[1] == DependencyProperty.UnsetValue))
                ? WizardPageButtonVisibility.Hidden
                : (WizardPageButtonVisibility)values[1];

            Visibility visibility = Visibility.Visible;

            switch (wizardPageVisibility)
            {
            case WizardPageButtonVisibility.Inherit:
                visibility = wizardVisibility;
                break;

            case WizardPageButtonVisibility.Collapsed:
                visibility = Visibility.Collapsed;
                break;

            case WizardPageButtonVisibility.Hidden:
                visibility = Visibility.Hidden;
                break;

            case WizardPageButtonVisibility.Visible:
                visibility = Visibility.Visible;
                break;
            }

            return(visibility);
        }