Coder Social home page Coder Social logo

giuseppenovielli / mvvmcrud Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 0.0 863 KB

MvvmCrud helps your Xamarin.Forms/MAUI app to standardize operations of creating, updating, deletion and display data, from REST API.

License: MIT License

C# 100.00%
crud-api crud-application crud-operation csharp maui-apps mvvm-architecture mvvm-pattern prismlibrary xamarin xamarin-forms

mvvmcrud's Introduction

MvvmCrud

MvvmCrud helps your Xamarin.Forms/MAUI app with Prism Library to standardize operations of creating, updating, deletion and display data, from REST API.

Preview Stable
Xamarin.Forms_5 NuGet version (MvvmCrud.Forms.Prism) NuGet version (MvvmCrud.Forms.Prism)
MAUI_NET7 NuGet version (MvvmCrud.Maui.Prism) NuGet version (MvvmCrud.Maui.Prism)

Example

mvvmcrud.mp4

How it works

This framework standardize CRUD's operations into ViewModel's file using generic T type, endpoint's requests and fully customizable.

The target is WRITE LESS CODE, STANDARDIZING THE MOST USED UI CRUD OPERATIONS, IMPROVE PRODUCTIVITY SPEED.

Only with these following lines of code your page can:

  • Display list of data
  • Embedded custom message, if endpoint fails
  • Embedded pagination's manager
  • Embedded Perform searchs
  • Embedded deletion cell's content, with automatic detect endpoint and confirm message
  • Embedded update cell's content, with automatic: detect endpoint, open page, save, upload and update list's cell
  • Embedded open detail's page
  • Embedded empty view UI
  • Embedded loadig more view UI

All fully customizable!

namespace MVVMCrud.Example.ViewModels.Post
{
    public class PostPageViewModel : BaseListPaginationAdvancedViewModel
        <PostCellViewModel, BaseModelItemsRoot<PostItem>, PostItem>
    {
        public PostPageViewModel(
            INavigationService navigationService,
            IRequestService requestService) : base(navigationService, requestService)
        {
        }

        public override string SetupEndpoint() => Constants.Constants.METHOD_POST;

        public override async void AddNewItem(PostItem item)
        {
            SetupAddItemMessage();
            await SetupGetItems();
        }

        public override async void UpdateEditItem(NewEditItem<PostItem> newEditItem)
        {
            SetupEditItemMessage();
            await SetupGetItems();
        }

        public override List<PostCellViewModel> PerformSearchSetup(string newText) => ItemsList.Where(x => x.Item.Title.Contains(newText.ToLower())).ToList();

        #region DetailPage
        public override string SetupDetailPageName(PostCellViewModel obj) => nameof(CommentPage);

        public override bool IsDetailPageWithHeader(PostCellViewModel obj) => true;
        #endregion

    }
}

Docs

Feedback or Requests

Use GitHub Issues for bug reports and feature requests.

Use GitHub Discussios for questions or opinions.

Disclaimer

This is at the moment an experiment. Use at your own risk.

Copyright and license

Code released under the MIT license.

Did you like ?

Buy Me A Coffee

mvvmcrud's People

Contributors

giuseppenovielli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.