Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spec: Use MVVM #51

Open
1 of 3 tasks
Lamparter opened this issue Oct 6, 2024 · 1 comment
Open
1 of 3 tasks

Spec: Use MVVM #51

Lamparter opened this issue Oct 6, 2024 · 1 comment
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Lamparter
Copy link
Collaborator

Lamparter commented Oct 6, 2024

πŸ“„ Description

Currently, Rebound does not implement MVVM namespace structure. Code should be moved from code-behind into reusable ViewModels/Models, like so:

  • Rebound.Models
  • Rebound.ViewModels
  • Rebound.Views

⚑ API Changes

API Description
VIEWS Contains views for pages with little code-behind except button handlers
MODELS Contains reusable models for logic
VIEWMODELS Contains ViewModels for logic attached to pages

πŸ‘₯ Usage scenarios

For example, the code-behind for the installer (InstallationWindow.xaml.cs) would now be a separate model.

πŸ”™ Backward Compatibility

Shouldn't affect anything.

πŸ€” Difficulty

Medium

@Lamparter Lamparter added the enhancement New feature or request label Oct 6, 2024
@github-project-automation github-project-automation bot moved this to πŸ“‹ To do in Rebound Oct 6, 2024
@Lamparter Lamparter changed the title Spec: add MVVM Spec: use MVVM Oct 6, 2024
@Lamparter Lamparter self-assigned this Oct 6, 2024
@Lamparter Lamparter pinned this issue Oct 9, 2024
@Lamparter
Copy link
Collaborator Author

I can't use MVVM app model as in [ObservableProperty] and bindings and etcetera but I can copy the classic MVVM project style, that looks like this:

  • Assets
  • Properties
  • Helpers
    • collapsed reusable code goes here

should mostly be in Rebound.Helpers but I'm kind of having second thoughts about it

  • Models
    • reusable app code goes here/core business logic
  • Views
    • pages/presentation go here
  • ViewModels

should probably just use code-behind for ViewModels

  • UserControls
  • MainPage.xaml
  • App.xaml

other files should not be here unless strictly necessary/appconfig files

@Lamparter Lamparter added this to the Refactor milestone Oct 9, 2024
@Lamparter Lamparter changed the title Spec: use MVVM Spec: Use MVVM Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: πŸ“‹ To do
Development

No branches or pull requests

1 participant