ActivateItemAsync don´t work over Dependency Injection
See original GitHub issueDescription
I am trying to create a button which could change ContentControl View via ActivateItemAsync
. After a lot of testing it looks like the view can´t be changed. After debugging I found out that the ActivateItemAsync
value will be changed but the view just doesn´t change. I don´t even get a error or warning message. Is there a known Bug?
I´ve created a more detailed post here. A hint would be very nice.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Caliburn Micro MVVM Multiple Active Items AND IoC ...
The biggest problem I ran into is, that I can't find a way to make the dependency injection, using a factory. The constructor...
Read more >When is it not appropriate to use the dependency injection ...
Basically, dependency injection makes some (usually but not always valid) assumptions about the nature of your objects. If those are wrong, ...
Read more >Qualms over the 'flexibility' advantage of using dependency ...
Your class (with the injectable dependencies) must use a base type or interface for its dependency. You can't just randomly inject any arbitrary ......
Read more >Dependency injection - .NET
Learn how to use dependency injection within your .NET apps. Discover how to registration services, define service lifetimes, ...
Read more >The Problem With Dependency Injection Frameworks
Let me be clear: I don't have a problem with dependency injection. One of my most popular articles is “Dependency Injection Demystified”, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I would try using an action message instead of injecting the
ShellVM
into the view. Like so:<Button Content="Click Me" cal:Message.Attach="[Event Click] = [Action SayHello(Name.Text)]" />
The reason it works when
ShellVW
is a singleton, is that you don’t get two instances ofShellVW
.Caliburn Micro sets the binding context for the
UserControl
so there should be no need to inject theShellVW
into theUserControl
.As for the warning I think that is a hard Caliburn Micro cannot guess about the intent of the user code.
Yea on normal redirection I would use the action but I need to translate also a full data object. I used the “A little Extended Implementation” from this post here. It´s the simplest way to use it and it´s also better readable. Maybe we find a better solution in the feature here.