Coder Social home page Coder Social logo

guntidheerajkumar / chick-and-paddy-dotnet-maui Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tuyen-vuduc/chick-and-paddy-dotnet-maui

0.0 0.0 0.0 3.51 MB

A sample application to demonstrate how to build a .NET MAUI app

License: MIT License

C# 100.00%

chick-and-paddy-dotnet-maui's Introduction

Overview

A small application to demo how to structure and architect a MAUI application.

UI Design

The app is built based on Chick & Paddy UI/UX design by Na Le

Screenshots

Sign in Sign up
News Feeds Stories

Documents

How-tos

Steps to create a new page

As we organize our app in Features with a consistent fold structure as description in High Level Design, below are key steps to add a new page for a feature.

  • Create a feature folder under Features if not exist
    • folder name must be the feature name
  • Create a Pages folder under the created feature folder
  • Create
    • a XAML page - inherits from BasePage
    • a VM class - inherits from NavigationAwareBaseViewModel or BaseViewModel

e.g. The SignIn page of Auth feature will have below structure

|
|--Features
    |--Auth
        |--Pages
            |--SignInPage.xaml
            |--SignInPage.xaml.cs
            |--SignInPageViewModel.cs

class diagram

classDiagram
    BasePage <|-- SignInPage: extends
    BaseViewModel <|-- NavigationAwareBaseViewModel: extends
    NavigationAwareBaseViewModel <|-- SignInPageViewModel: extends
    SignInPage o-- SignInPageViewModel: BindingContext

    class BaseViewModel {
        + Task OnAppearingAsync()
        + Task OnDisappearingAsync()
    }
    <<abstract>> BaseViewModel
    class NavigationAwareBaseViewModel {
        + void OnBack(IDictionary<string, object> query)
        + void OnInit(IDictionary<string, object> query)
    }
    <<abstract>> NavigationAwareBaseViewModel
    class BasePage {
        # void OnAppearing()
        # void OnDisappearing()
    }
    <<abstract>> BasePage

Use script

# e.g. dotnet cake --target=page --feature Auth --name SignIn
dotnet cake --target=page --feature FEATURE_NAME --name PAGE_NAME_WO_SUFFIX

Steps to create a new popup

As we organize our app in Features with a consistent fold structure as description in High Level Design, below are key steps to add a new popup for a feature.

  • Create a feature folder under Features if not exist
    • folder name must be the feature name
  • Create a Popups folder under the created feature folder
  • Create
    • a XAML page - inherits from BasePopup
    • a VM class - inherits from NavigationAwareBaseViewModel or BaseViewModel

e.g. The PairingRejectedPopup page of Pairing feature will have below structure

|
|--Features
    |--Pairing
        |--Popups
            |--PairingRejectedPopup.xaml
            |--PairingRejectedPopup.xaml.cs
            |--PairingRejectedPopupViewModel.cs

class diagram

classDiagram
    BasePage <|-- BasePopup: extends
    BasePopup <|-- PairingRejectedPopup: extends
    BaseViewModel <|-- NavigationAwareBaseViewModel: extends
    NavigationAwareBaseViewModel <|-- PairingRejectedPopupViewModel: extends
    PairingRejectedPopup o-- PairingRejectedPopupViewModel: BindingContext

    class BaseViewModel {
        + Task OnAppearingAsync()
        + Task OnDisappearingAsync()
    }
    <<abstract>> BaseViewModel
    class NavigationAwareBaseViewModel {
        + void OnBack(IDictionary<string, object> query)
        + void OnInit(IDictionary<string, object> query)
    }
    class BasePopup {
        // Shell.PresentationMode="Modal"
    }
    <<abstract>> BasePopup
    class BasePage {
        # void OnAppearing()
        # void OnDisappearing()
    }
    <<abstract>> BasePage

Use script

# e.g. dotnet cake --target=popup --feature Pairing --name PairingRejected
dotnet cake --target=popup --feature FEATURE_NAME --name POPUP_NAME_WO_SUFFIX

Steps to create a new model

As we organize our app in Features with a consistent fold structure as description in High Level Design, below are key steps to add a new model for a feature.

  • Create a feature folder under Features if not exist
    • folder name must be the feature name
  • Create a Models folder under the created feature folder
  • Create
    • a Model class - inherits from BaseModel or BaseFormModel

BaseFormModel will be used when the UI are entry elements; otherwise BaseModel. BaseFormModel will leverage the validation feature of MVVM toolkit.

e.g.

  • The SignIn form model of Auth feature will have below structure
|
|--Features
    |--Auth
        |--Models
            |--SignInFormModel.cs
  • The WalkthroughItem model of Landing feature will have below structure
|
|--Features
    |--Landing
        |--Models
            |--WalkthroughItemModel.cs

class diagram

classDiagram
    BaseModel <|-- WalkthroughItemModel: extends
    BaseFormModel <|-- SignInFormModel: extends
    ObservableValidator <|-- BaseFormModel: extends
    ObservableObject <|-- ObservableValidator: extends
    ObservableObject <|-- BaseModel: extends
l
    class BaseFormModel
    <<abstract>> BaseFormModel
    class BaseFormModel {
        # string[] ValidatableAndSupportPropertyNames
        + bool IsValid()
    }
    <<abstract>> BaseFormModel
    class ObservableValidator {
        // MVVM toolkit
    }
    <<abstract>> ObservableValidator
    class ObservableObject {
        // MVVM toolkit
    }
    <<abstract>> ObservableObject

Use script

# e.g. dotnet cake --target=model --form true --feature Auth --name SignIn
dotnet cake --target=popup --feature FEATURE_NAME --name MODEL_NAME_WO_SUFFIX --form true

# e.g. dotnet cake --target=model --feature Landing --name WalkthroughItem
dotnet cake --target=popup --feature FEATURE_NAME --name MODEL_NAME_WO_SUFFIX

Open Source libraries

Other resources

Maintainer

This project is maintained by tuyen-vuduc in his spare time.

If you find this project is useful, please become a sponsor of the project and/or buy him a coffee.

"Buy Me A Coffee"

License

The 3rd libraries will follow their associated licenses. This project itself is license under MIT license.

Copyright 2022 Tuyen Vu

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

chick-and-paddy-dotnet-maui's People

Contributors

tuyen-vuduc avatar tuyen-trigent 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.