Inheritance: GalaSoft.MvvmLight.ObservableObject
    public CategoryViewModel(Category category, ProgramsViewModel programsViewModel)
    {
      Category = category;
      _programsViewModel = programsViewModel;

      Programs = new ObservableCollection<SimpleProgramViewModel>();
      ShowMore();
    }
Ejemplo n.º 2
0
        public MainViewModel()
        {
            OpenProgramCommand = new RelayCommand<LocalProgramHeader>(OpenProgramCommandAction);
            DeleteLocalProgramCommand = new RelayCommand<string>(DeleteLocalProgramAction);
            CopyLocalProgramCommand = new RelayCommand<string>(CopyLocalProgramAction);
            OnlineProgramTapCommand = new RelayCommand<OnlineProgramHeader>(OnlineProgramTapAction);
            SettingsCommand = new RelayCommand(SettingsAction);
            CreateNewProgramCommand = new RelayCommand(CreateNewProgramAction);
            ShowMessagesCommand = new RelayCommand(ShowMessagesAction);
            AboutCommand = new RelayCommand(AboutAction);
            LicenseCommand = new RelayCommand(LicenseAction);

            Messenger.Default.Register<MessageBase>(this,
                ViewModelMessagingToken.LocalProgramsChangedListener, LocalProgramsChangedMessageAction);

            Messenger.Default.Register<GenericMessage<string>>(this,
                ViewModelMessagingToken.DownloadProgramStartedListener, DownloadProgramStartedMessageAction);

            Messenger.Default.Register<GenericMessage<string>>(this,
               ViewModelMessagingToken.UploadProgramStartedListener, UploadProgramStartedMessageAction);

            Messenger.Default.Register<GenericMessage<CatrobatContextBase>>(this,
               ViewModelMessagingToken.ContextListener, ContextChangedMessageAction);

            Messenger.Default.Register<GenericMessage<Program>>(this,
                 ViewModelMessagingToken.CurrentProgramChangedListener, CurrentProgramChangedMessageAction);

            Messenger.Default.Register<GenericMessage<ToastTag>>(this,
                ViewModelMessagingToken.ToastNotificationActivated, ToastNotificationActivatedMessageAction);

            OnlineProgramsViewModel = new ProgramsViewModel();
        }