Replies: 2 comments
-
Thank you for your feedback.
|
Beta Was this translation helpful? Give feedback.
-
Yes, I have also worked on adding attributes|interface to VMs (ViewModels) to make the subclass match the parent class's V (View), or to make a single V match multiple VMs. However, the latter scenario is relatively rare. There are also mechanisms similar to "FallBack" for handling such cases. |
Beta Was this translation helpful? Give feedback.
-
Some Suggestions for Version 5
Due to the addition of new GUI platforms and the existing asynchronous support, I have some ideas here that I hope to discuss and confirm.
Regarding Naming
Since this is a new version, we can adjust the naming under permissible conditions, of course, with some principles:
If there are names that are similar but have different functions, or if the code input characters are too similar to make use of code prompts difficult, it is recommended to modify them.
If the code that can be easily completed may conflict with the definition or even cause errors, or if the names are not understandable to users, it is recommended to modify them.
Any modifications must be marked with how to upgrade from V4 to V5, and should be easily accessible in the official documentation.
The following code example meets condition 1.
The following illustrates the naming issue of
cal:View.Context
.MyNamespace.Views.StudentViewModel.
locate to:MyNamespace.Views.StudentView
.locate with context (
Details
):MyNamespace.Views.Student.Details
.A question that was raised a long time ago: It pollutes the name definition.
I must define a namespace like
xxx.Student.xxx
. But I also have a model namedxxx.Student.cs
. It's weird to reference members.Student
is a class, and also is a namespace.The following illustrates the issue of conflicting with common types, but it may also be difficult to improve the current situation.
Caliburn.Micro.Action
often conflicts with the existingSystem.Action
, but it is generally only used in views, and its namespace can be modified to prevent it from using the same namespace as common types.Caliburn.Micro.Screen
may also often cause trouble withSystem.Windows.Forms.Screen
andAvalonia.Platform.Screen
, but this class is very commonly used, while the platform-specific classes like forms and avalonia are less commonly used, so the necessity for modification is lower.Support for Asynchrony
The following demonstrates that if we have asynchronous methods, we can also retain the old synchronous methods, which might prevent the writing of some strange code.
However, this could also potentially lead to the mistake of writing
void task
.The following demonstrates that if we use a synchronous approach to execute asynchronous methods, we should add more states, rather than just a boolean value, to prevent strange results:
Beta Was this translation helpful? Give feedback.
All reactions