Refactor state-less-components.md to use working code and commentary#14
Open
brotherbill wants to merge 2 commits intoadospace:mainfrom
Open
Refactor state-less-components.md to use working code and commentary#14brotherbill wants to merge 2 commits intoadospace:mainfrom
brotherbill wants to merge 2 commits intoadospace:mainfrom
Conversation
adospace
requested changes
Jan 14, 2025
| This app will be focused on teaching, so is quite incomplete. | ||
| For example, no exception handling, no reading of the user name or password entered. Several useless buttons. | ||
|
|
||
| 1. Install MauiReactor templates to Visual Studio 2022 *(if not already installed)* |
Owner
There was a problem hiding this comment.
We should try not to focus only on Visual Studio 2022 and Windows, the same template can be adopted on other IDEs and platforms
Contributor
Author
|
Visual Studio 2022 is the primary IDE and Windows Machine is the easiest to get started.
Alternatives such as JetBrains Rider exist.
Readers can make the obvious choice to use Rider instead of VS2022, or VS2025 when it ships.
A concrete start for newbies is useful to get started.
Once a reader has it running on Windows Machine, it is a small step to run on emulators or genuine attached Android or iPhone smartphones.
I concur that there are other IDEs and platforms, but one must build early success with the easiest approach, which is VS2022 plus Windows Machine.
In README.md:
- HStack( // Horizontal Stack
- Button("Login"),
- Button("Register")
- )
- )
- .Center()
- );
-}
-```
+NO XAML needed, just using C# you can write fluent declarative UI with MauiReactor components.
+
+Let's build our first Component based app from scratch, so you get the flavor of working with MauiReactor.
+This app will be focused on teaching, so is quite incomplete.
+For example, no exception handling, no reading of the user name or password entered. Several useless buttons.
+
+1. Install MauiReactor templates to Visual Studio 2022 *(if not already installed)*
We should try not to focus only on Visual Studio 2022 and Windows, the same template can be adopted on other IDEs and platform
Message ID: ***@***.***>
|
adospace
reviewed
Jan 15, 2025
| - **Never** name your `_variable` as a Component name, such as `[Prop] string _label;` | ||
| Doing so will break the project with an infinite loop, never seeing your page render. | ||
| - The component `class` must be `partial` and inherit from `Component`. | ||
| - The `[Prop]` name must start with underscore and be `_camelCase`. |
Owner
There was a problem hiding this comment.
It's not required to have the field starting with an underscore
adospace
reviewed
Jan 15, 2025
| - The `[Prop]` name must start with underscore and be `_camelCase`. | ||
| - Within the Component, use `_labelText` throughout as the example does. | ||
| - Each property that will be passed in has the `[Prop]` attribute. | ||
| - Each `[Prop]` should skip the access part such as `public`/`protected`/`internal`/`private`, which will be ignored by the MauiReactor code generator. |
Owner
There was a problem hiding this comment.
It's not ignored but preserved, for example, it's perfectly valid to create a prop protected if you want to access it from a derived component class
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Working code is ideal for learning. This has extensive commentary for user to play well with code generator.