private void OnFiltersClick(object sender, System.Windows.RoutedEventArgs e)
        {
            if (m_cardCollector != null && m_parameters != null)
            {
                ParametersDialog dialog = new ParametersDialog(m_parameters.DeepClone())
                {
                    Owner = this
                };

                if (dialog.ShowDialog().Value)
                {
                    m_parameters = dialog.Parameters.DeepClone();

                    Settings.SearchParameters = dialog.Parameters.DeepClone();
                }
                else
                {
                }
            }
            else
            {
            }
        }
 private void EditParameters_Click(object sender, RoutedEventArgs e) => ParametersDialog.ShowAsync();
Esempio n. 3
0
        public override object EditValue(ITypeDescriptorContext context, IServiceProvider provider, object value)
        {
            Assert.ArgumentNotNull(context, nameof(context));
            Assert.ArgumentNotNull(provider, nameof(provider));

            var instance = context.Instance;

            if (instance == null)
            {
                return(value);
            }

            IEnumerable <RenderingItem> renderingItems = null;

            var renderingItem = instance as RenderingItem;

            if (renderingItem != null)
            {
                renderingItems = new[]
                {
                    renderingItem
                };
            }

            var objects = instance as object[];

            if (objects != null)
            {
                renderingItems = objects.OfType <RenderingItem>();
            }

            if (renderingItems == null || !renderingItems.Any())
            {
                return(value);
            }

            var container = renderingItems.First().RenderingContainer;

            if (container == null)
            {
                return(value);
            }

            var parameterDictionary = value as ParameterDictionary;

            if (parameterDictionary == null)
            {
                return(value);
            }

            var dialog = new ParametersDialog();

            dialog.Initialize(parameterDictionary.Parameters);
            if (AppHost.Shell.ShowDialog(dialog) != true)
            {
                return(value);
            }

            var result = new ParameterDictionary(dialog.Parameters);

            return(result);
        }