示例#1
0
        private void OpenListingItemDetail(int day)
        {
            ViewModelResolver.Resolve(nameof(ListingItemViewModel));

            EventAggregator.PublishOnUIThread(new EditDayItemMessage(_dayItems[day - 1]));
            EventAggregator.PublishOnUIThread(new ChangeViewMessage(nameof(ListingItemViewModel)));
        }
示例#2
0
        private void DisplayPdfGenerationPage()
        {
            ViewModelResolver.Resolve(nameof(ListingPdfGenerationViewModel));

            EventAggregator.PublishOnUIThread(new ListingMessage(Listing));
            EventAggregator.PublishOnUIThread(new ChangeViewMessage(nameof(ListingPdfGenerationViewModel)));
        }
        private void DisplayRecordUpdate()
        {
            PersonFormViewModel vm = ViewModelResolver.Resolve <PersonFormViewModel>();

            vm.Person = Person;

            EventAggregator.BeginPublishOnUIThread(new ChangeViewMessage <IViewModel>(vm));
        }
示例#4
0
        private void OpenEditing()
        {
            // we need to create view model first before we can send a message to it
            // second time and on the resolver(SimpleContainer precisely) wont create new one(it is declared as Singleton)
            ViewModelResolver.Resolve(nameof(ListingEditingViewModel));

            EventAggregator.PublishOnUIThread(new ListingMessage(Listing));
            EventAggregator.PublishOnUIThread(new ChangeViewMessage(nameof(ListingEditingViewModel)));
        }
示例#5
0
        private void LoadLocalPlaylists()
        {
            var result = _service.GetLocalPlaylists();

            if (result.IsSuccess)
            {
                LocalPlaylists.AddRange(result.Data.Select(x => ViewModelResolver.Resolve <PlaylistViewModel>(x)));
            }
        }
        protected P GetViewModel(System.Type viewModel)
        {
            P vm = ViewModelResolver.Resolve <P>(viewModel);

            if (vm == null)
            {
                throw new Exception("Requested ViewModel does not Exist!");
            }

            return(vm);
        }
        protected VM GetViewModel <VM>() where VM : P
        {
            VM vm = ViewModelResolver.Resolve <VM>();

            if (vm == null)
            {
                throw new Exception("Requested ViewModel does not Exist!");
            }

            return(vm);
        }
示例#8
0
        protected override void OnInitialize()
        {
            base.OnInitialize();

            EventAggregator.Subscribe(this);

            ActivateItem(ViewModelResolver.Resolve <PersonDetailViewModel>());

            LeftSide  = ActivateItem <PersonsOverviewViewModel>();
            RightSide = ActivateItem <EmptySelectionViewModel>();
        }
示例#9
0
        private void LoadFavorites()
        {
            var result = _service.GetSoundCloudFavorites();

            if (!result.IsSuccess)
            {
                return;
            }

            var viewModel = ViewModelResolver.Resolve <PlaylistViewModel>(result.Data);

            viewModel.IsDeletable = false;
            viewModel.LoadNextPage.Execute(null);

            SoundCloudPlaylists.Insert(1, viewModel);
        }
        protected override void OnInitialize()
        {
            base.OnInitialize();

            EventAggregator.Subscribe(this);

            _personsListViewModel = ViewModelResolver.Resolve <PersonsListViewModel>();

            _filterOptions = new Dictionary <FilterOptions, string>();
            _filterOptions.Add(ViewModels.FilterOptions.ALL, "Všechny záznamy");
            _filterOptions.Add(ViewModels.FilterOptions.UPCOMMING, "Pouze nadcházející narozeniny");
            _filterOptions.Add(ViewModels.FilterOptions.LAST, "Pouze uplynulé narozeniny");

            SelectedFilter = ViewModels.FilterOptions.UPCOMMING;

            LoadRecords();
        }
示例#11
0
        private void LoadPlaylists()
        {
            var result = _service.GetSoundCloudPlaylists();

            if (!result.IsSuccess)
            {
                return;
            }

            foreach (var model in result.Data)
            {
                var viewModel = ViewModelResolver.Resolve <PlaylistViewModel>(model);
                viewModel.IsDeletable = false;
                viewModel.LoadNextPage.Execute(null);

                SoundCloudPlaylists.Add(viewModel);
            }
        }
示例#12
0
        private void AddPlaylistImpl()
        {
            //// TODO Add Playlist-Name Dialog

            var playlist = new LocalPlaylistModel();

            playlist.Name = "PlaylistName";

            var result = _service.Save(playlist);

            if (!result.IsSuccess)
            {
                return;
            }

            var model = ViewModelResolver.Resolve <PlaylistViewModel>(result.Data);

            LocalPlaylists.Add(model);
            CurrentPlaylist = model;
        }
示例#13
0
 protected ViewControllerBase(string name, NSBundle p)
     : base(name, p)
 {
     ViewModel = ViewModelResolver?.Resolve <TViewModel>();
 }
示例#14
0
 protected ViewControllerBase(IntPtr handle)
     : base(handle)
 {
     ViewModel = ViewModelResolver?.Resolve <TViewModel>();
 }
示例#15
0
 protected virtual T Resolve <T>()
     where T : class
 {
     return(ViewModelResolver?.Resolve <T>());
 }
示例#16
0
        protected override void ConfigureViewModelLocator()
        {
            base.ConfigureViewModelLocator();
            var resolver        = new ViewModelResolver();
            var currentAssembly = typeof(ShellWindow).Assembly;

            ViewModelLocationProvider.SetDefaultViewTypeToViewModelTypeResolver(viewType => resolver.Resolve(viewType, currentAssembly));
        }
 public TabBarViewControllerBase(IntPtr handle)
     : base(handle)
 {
     ViewModel = ViewModelResolver?.Resolve <TViewModel>();
 }
示例#18
0
 public FragmentBase(bool hasNonTrackableBindings = false)
     : base(hasNonTrackableBindings)
 {
     ViewModel = ViewModelResolver?.Resolve <TViewModel>();
 }