Git Product home page Git Product logo

xamarinforms-unobtrusivevalidationplugin's People

Contributors

james-russo avatar jrummell-elite avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

xamarinforms-unobtrusivevalidationplugin's Issues

Any plans to have this nuget supporting for MAUI?

There are projects which were done in Xamarin and the current nuget package supported well. As Microsoft recommends to migrate to Maui the current nuget package doesn't support it.

Any suggestion and thoughts about it?

ValidatablePickerControl

Hey,

I am trying to extend the functionality to include a validatablePickerControl. I have this largely working except i cannot pass through the ItemDisplayBinding from the xaml. Below is some code snippets. Any pointers greatly appreciated.

    public static BindableProperty ItemDisplayBindingProperty = BindableProperty.Create(
        nameof(ItemDisplayBinding),
        typeof(BindingBase),
        typeof(ValidatablePicker));

    public BindingBase ItemDisplayBinding
    {
        get => _picker.ItemDisplayBinding;
        set => _picker.ItemDisplayBinding = value;
    }
    /// <summary>
    /// </summary>
    public ValidatablePicker()
    {
        _picker.BindingContext = this;
        _picker.SetBinding(Picker.ItemsSourceProperty, nameof(ItemsSource));
        _picker.SetBinding(Picker.TitleProperty, nameof(Title));
        _picker.SetBinding(Picker.SelectedIndexProperty, nameof(SelectedIndex));

        _picker.ItemDisplayBinding = ItemDisplayBinding;

        Children.Add(_picker);

        _errorLabel.SetBinding(IsVisibleProperty, nameof(IsInValid));
        _errorLabel.SetBinding(Label.TextProperty, nameof(Message));
        _errorLabel.BindingContext = this;
        _errorLabel.TextColor = Color.Red;

        Children.Add(_errorLabel);
    }

                    <controls:ValidatablePicker
                SelectedIndex="{Binding Model.TypeSelectedIndex, Mode=TwoWay}"
                ItemsSource="{Binding AssetTypes}"
                ItemDisplayBinding="{Binding Description}"
                BindingName="AssetTypeId"
                Title="Select asset type"
                />

How to use FluentValidation 9.+ with this plugin

I've been using your plugin for a while as the best way to do validation in my Xamarin project.

However, with the recent update to FluentValidation 9.0.1 the plugin does not work any more. The FluentValidation.ValidatorAttribute package is not supported on 9.+ and that gives a challenge in the AbstractValidationViewModel method:

        public ValidationResult GetValidationResult()
        {
            var attributeFactory = new AttributedValidatorFactory();
            var type = GetType();
            var validator = attributeFactory.GetValidator(type);
            var results = validator.Validate(this);
            return results;
        }

as the AttributedValidatorFactory doesn’t exist any more. I'm not sure how to work around this?

The migration documentation in FluentValidation suggests using an IoC container instead - but that seems quite another approach to what this plugin does - so I'm not sure how to do this (still a little new on DI though I'm building on Prism using DryIoc).

Hoping to get some suggestions to go with.

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.