4

In this example https://github.com/MvvmCross/MvvmCross-Tutorials/tree/master/DialogExamples/DialogExamples.Droid

the MvxDialogFragment is launched from the Activity.

How can I do to show My MvxDialogFragment directly from ViemModel?

I have two ViewModels: ListViewModel And DetailViewModel

In ListViewModel:

public DetailViewModel SelectedItem
    {
        get { return _SelectedItem; }
        set
        {
            _SelectedItem = value;
            ShowViewModel<DetailViewModel>(new { id = value.Model.Id }); //Show my activity in Dialog mode
        }
    }

Thank you in advance.

chamamo
  • 270
  • 2
  • 12
  • Similar to http://stackoverflow.com/questions/18609018/mvvmcross-dialog – Stuart Dec 05 '13 at 18:23
  • 1
    Thank you Stuart but it is not what I need, I don't need juste an confirmation, I need to retrieve somme Data that's why I need to do that via fragment. I found MvxDialogFragment class to do that but I can't show it directly from my viewModel, and there is no class for DialogActivity in your framework. – chamamo Dec 05 '13 at 20:48
  • Sorry I don't understand what you mean by a class for `DialogActivity`. Perhaps you could include more detail (code, diagrams, explanation) in your question to explain what you are looking to do. – Stuart Dec 06 '13 at 09:36

1 Answers1

0

I think you should look into this. It contains an example of an MvxDialogFragment with its viewmodel

Pap
  • 149
  • 1
  • 4
  • 12