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

Streamlined by removing AutoWireViewModel #25

Closed
wants to merge 1 commit into from

Conversation

dvorn
Copy link
Contributor

@dvorn dvorn commented Nov 22, 2016

This PR is not intended to be merged. It is here to give an example of how interactivity can be simplified if it does not attempt to use AutoWireViewModel but follow viewmodel-first approach.

See ItemSelection sample.

Actually the definitions of the interfaces are a bit messy (and some members are actually not used in this sample). But streamlining the interfaces will be a breaking change.

@briannoyes
Copy link
Contributor

Ok now I understand more where this discussion is coming from, was not aware that usage of AutoWireViewModel slipped into the Interactivity QuickStart at some point. I know how to derive from Confirmation or Notification to extend the viewmodel for the presented dialog view - I was involved in the original implementation in Prism 4. Agree we should either remove the use of AutoWireViewModel from the quickstart due to the impedance mismatch, or just add like you did to show both approaches, because it is not that AutoWireViewModel cannot work with InteractionRequest, there are some scenarios where it works fine. It just doesn't if you want the ViewModel to be tied into the lifecycle of the interaction more directly.

Perhaps showing both in the Quickstart would cover all bases there.

In terms of "streamlining the interfaces", would have to see what you are proposing in PRs that show the implementation and the usages.

@dvorn
Copy link
Contributor Author

dvorn commented Nov 23, 2016

@briannoyes

Ok now I understand more where this discussion is coming from, was not aware that usage of AutoWireViewModel slipped into the Interactivity QuickStart at some point.

Actually the problem is not with AutoWireViewModel. In Prism v5 it goes like this:

    public partial class ItemSelectionView : UserControl
    {
        public ItemSelectionView()
        {
            this.DataContext = new ItemSelectionViewModel();
            InitializeComponent();
        }
    }

Thus, it is the problem with original design of quickstart and prism interactivity.

@brianlagunas
Copy link
Member

I have changed all the samples and created a more guided approach to the samples.

@dvorn dvorn deleted the Simplification branch February 27, 2017 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants