示例#1
0
 public ComicContentViewModel(ComicReaderViewModel mainViewModel, string fileName) : base(false)
 {
     // Asigna las propiedades
     MainViewModel = mainViewModel;
     FileName      = fileName;
     // Inicializa los objetos
     ComicPages = new ControlListViewModel();
     // Inicializa los comandos
     FirstPageCommand = new BaseCommand(_ => GoFirstPage(), _ => CanGoFirstPage())
                        .AddListener(ComicPages, nameof(ComicPages.SelectedItem));
     LastPageCommand = new BaseCommand(_ => GoLastPage(), _ => CanGoLastPage())
                       .AddListener(ComicPages, nameof(ComicPages.SelectedItem));
     NextPageCommand = new BaseCommand(_ => GoNextPage(), _ => CanGoNextPage())
                       .AddListener(ComicPages, nameof(ComicPages.SelectedItem));
     PreviousPageCommand = new BaseCommand(_ => GoPreviousPage(), _ => CanGoPreviousPage())
                           .AddListener(ComicPages, nameof(ComicPages.SelectedItem));
 }
示例#2
0
 /// <summary>
 ///		Inicializa el manager de vistas del lector de cómics
 /// </summary>
 public void Initialize(IAppViewsController appViewsController, PluginsStudio.ViewModels.Base.Controllers.IPluginsController pluginController)
 {
     AppViewsController = appViewsController;
     MainViewModel      = new ComicReaderViewModel(new Controllers.ComicReaderController(this, pluginController));
     MainViewModel.Initialize();
 }