Exemplo n.º 1
0
        public MainNavigationPage()
        {
            InitializeComponent();

            viewModel = (IMainNavigationViewModel)Splat.Locator.Current.GetService(typeof(IMainNavigationViewModel));

            BindingContext = viewModel;
        }
Exemplo n.º 2
0
        private MainNavigationEntry CreateNavigationEntry(IMainNavigationViewModel viewModel)
        {
            var navigationCommand = new RelayCommand(
                () =>
            {
                _navigationService.NavigateToAsync(viewModel);
            });

            return(new MainNavigationEntry(navigationCommand, viewModel.NavigationDescription));
        }
Exemplo n.º 3
0
        public MainViewModel
        (
            IMainNavigationViewModel mainNavigationViewModel,
            IEventAggregator eventAggregator,
            IMessageDialogService messageDialogService,
            IViewModelFactory viewModelFactory
        )
        {
            MainNavigationViewModel = mainNavigationViewModel;
            _viewModelFactory       = viewModelFactory;
            _eventAggregator        = eventAggregator;
            _messageDialogService   = messageDialogService;

            _eventAggregator.GetEvent <EventOpenNavigationOrDetailViewModel>().Subscribe(OnEventOpenNavigationOrDetailViewModel);
            _eventAggregator.GetEvent <EventAfterDetailDeleted>().Subscribe(OnEventAfterDetailDeleted);
            _eventAggregator.GetEvent <EventAfterDetailClose>().Subscribe(OnEventAfterDetailClose);

            ViewModels = new ObservableCollection <IViewModel>();

            CommandCreateSingleDetailView = new DelegateCommand <Type>(OnCommandCreateSingleDetailView);

            IsMainNavigationViewShown = false;
        }