コード例 #1
0
        public FavoritesViewModel()
        {
            GotoFavoritesCommand.IsExecutable = false;

            _favoritesService  = Mvx.Resolve <IFavoritesService>();
            _parametersManager = Mvx.Resolve <IParametersManager>();

            UnfavoriteCommand = new Common.Mvvm.Command(UnfavoriteCommandImpl, false);
        }
コード例 #2
0
        public AdditionalArticlesList(Dictionary.WordList model)
        {
            _model             = model;
            ItemClickCommand   = new Common.Mvvm.Command(ItemClickCommandImpl);
            HeaderClickCommand = new Common.Mvvm.Command(HeaderClickCommandImpl);
            Items = new ObservableCollection <DictionaryItem>();

            FillItems();
        }
コード例 #3
0
        public DictionaryViewModel()
        {
            BackCommand.IsExecutable           = false;
            GotoDictionaryCommand.IsExecutable = false;

            _dictionaryService = Mvx.Resolve <IDictionaryService>();
            _historyService    = Mvx.Resolve <IHistoryService>();
            _favoritesService  = Mvx.Resolve <IFavoritesService>();
            _parametersManager = Mvx.Resolve <IParametersManager>();

            SearchQuerySubmittedCommand = new Common.Mvvm.Command(SearchQuerySubmittedCommandImpl);
        }
コード例 #4
0
        internal HistoryService()
        {
            _dictionaryService = Mvx.Resolve <IDictionaryService>();
            _userInteraction   = Mvx.Resolve <IUserInteraction>();
            _itemsController   = Mvx.Resolve <IItemsController>();
            _parametersManager = Mvx.Resolve <IParametersManager>();
            _uiIDispatcher     = Mvx.Resolve <Common.IUIDispatcher>();

            ItemClickCommand = new Common.Mvvm.Command(ItemClickCommandImpl);
            ClearCommand     = new Common.Mvvm.Command(ClearCommandImpl, false);

            Initialize();
        }
コード例 #5
0
        internal DictionaryList(string name, DictionaryListType type, ICollection <Dictionary.ListItem> items)
        {
            _itemsController = Mvx.Resolve <IItemsController>();

            Name     = name;
            Type     = type;
            Items    = new ObservableCollection <DictionaryItem>();
            TopItems = new ObservableCollection <DictionaryItem>();

            ItemClickCommand   = new Common.Mvvm.Command(ItemClickCommandImpl);
            HeaderClickCommand = new Common.Mvvm.Command(HeaderClickCommandImpl);

            Initialize(items);
        }
コード例 #6
0
        public EnterCodeViewModel()
        {
            _productsCatalog = Mvx.Resolve <IProductsCatalog>();

            BackCommand.IsExecutable            = false;
            GotoCatalogCommand.IsExecutable     = false;
            GotoDictionaryCommand.IsExecutable  = false;
            GotoHistoryCommand.IsExecutable     = false;
            GotoFavoritesCommand.IsExecutable   = false;
            GotoInformationCommand.IsExecutable = false;

            OkCommand = new Common.Mvvm.Command(OkCommandImpl);

            SetHeader();
        }
コード例 #7
0
        internal ProductsCatalog()
        {
            _fileAccessorFactory = Mvx.Resolve <Common.IFileAccessorFactory>();
            _fileDownloader      = Mvx.Resolve <Common.IFileDownloader>();
            _inAppService        = Mvx.Resolve <Common.IInAppService>();
            _resourcesProvider   = Mvx.Resolve <Common.IResourcesProvider>();
            _productsDatabase    = Mvx.Resolve <IProductsDatabase>();
            _userInteraction     = Mvx.Resolve <IUserInteraction>();

            UpdatePurchasesStatusCommand = new Common.Mvvm.Command(UpdatePurchasesStatusCommandImpl, true);

            _productsDatabase.ProductAdded += OnProductsDatabaseProductAdded;

            ReadCatalog();
        }
コード例 #8
0
        public ViewModelBase()
        {
            BackCommand            = new Common.Mvvm.Command(BackCommandImpl);
            GotoCatalogCommand     = new Common.Mvvm.Command(GotoCatalogCommandImpl);
            GotoDictionaryCommand  = new Common.Mvvm.Command(GotoDictionaryCommandImpl);
            GotoHistoryCommand     = new Common.Mvvm.Command(GotoHistoryCommandImpl);
            GotoFavoritesCommand   = new Common.Mvvm.Command(GotoFavoritesCommandImpl);
            GotoInformationCommand = new Common.Mvvm.Command(GotoInformationCommandImpl);

            IDictionaryService dictionaryService = Mvx.Resolve <IDictionaryService>();

            if (dictionaryService.AdditionalArticles.Count == 0)
            {
                GotoInformationCommand.IsExecutable = false;
            }
        }
コード例 #9
0
        public DictionaryService()
        {
            _resourcesProvider = Mvx.Resolve <Common.IResourcesProvider>();
            _itemsController   = Mvx.Resolve <IItemsController>();
            _searchQueryTimer  = Mvx.Resolve <Common.ITimer>();

            AdditionalArticles = new ObservableCollection <AdditionalArticlesList>();
            Hints         = new ObservableCollection <DictionaryItem>();
            SearchResults = new ObservableCollection <DictionaryList>();

            SearchCommand          = new Common.Mvvm.Command(SearchCommandImpl);
            SwitchDirectionCommand = new Common.Mvvm.Command(SwitchDirectionCommandImpl);
            HintClickCommand       = new Common.Mvvm.Command(HintClickCommandImpl);

            _searchQueryTimer.Interval = new TimeSpan(0, 0, 0, 0, 300);
            _searchQueryTimer.Tick    += SearchQueryTimerOnTick;
        }
コード例 #10
0
        public ArticleViewModel()
        {
            _soundPlayer             = Mvx.Resolve <Dictionary.ISoundPlayer>();
            _articleRenderingService = Mvx.Resolve <IArticleRenderingService>();
            _dictionaryService       = Mvx.Resolve <IDictionaryService>();
            _parametersManager       = Mvx.Resolve <IParametersManager>();
            _historyService          = Mvx.Resolve <IHistoryService>();
            _favoritesService        = Mvx.Resolve <IFavoritesService>();
            _deviceInformation       = Mvx.Resolve <Common.IDeviceInformation>();
            _settingsManager         = Mvx.Resolve <Common.ISettingsManager>();

            PlaySoundCommand       = new Common.Mvvm.Command(PlaySoundCommandImpl, false);
            FavoriteCommand        = new Common.Mvvm.Command(FavoriteCommandImpl, false);
            UnfavoriteCommand      = new Common.Mvvm.Command(UnfavoriteCommandImpl, false);
            OpenHideBlocksCommand  = new Common.Mvvm.Command(OpenHideBlocksCommandImpl, false);
            CloseHideBlocksCommand = new Common.Mvvm.Command(CloseHideBlocksCommandImpl, false);
            MorphoTableCommand     = new Common.Mvvm.Command(MorphoTableCommandImpl, false);
        }
コード例 #11
0
        internal PBase(Models.PBase model)
        {
            _model = model;

            _userInteraction   = Mvx.Resolve <IUserInteraction>();
            _fileDownloader    = Mvx.Resolve <Common.IFileDownloader>();
            _resourcesProvider = Mvx.Resolve <Common.IResourcesProvider>();
            _uiDispatcher      = Mvx.Resolve <Common.IUIDispatcher>();

            _fileDownloader.Started       += FileDownloaderOnStarted;
            _fileDownloader.Progress      += FileDownloaderOnProgress;
            _fileDownloader.Complited     += FileDownloaderOnComplited;
            _fileDownloader.ErrorOccurred += FileDownloaderOnErrorOccurred;

            DownloadCommand = new Common.Mvvm.Command(DownloadCommandImpl, false);
            StopCommand     = new Common.Mvvm.Command(StopCommandImpl, false);

            Initialize();
        }
コード例 #12
0
ファイル: Product.cs プロジェクト: Vigelforts/TestProject
        internal Product(Models.Product model)
        {
            _model = model;

            _inAppService     = Mvx.Resolve <Common.IInAppService>();
            _userInteraction  = Mvx.Resolve <IUserInteraction>();
            _productsDatabase = Mvx.Resolve <IProductsDatabase>();
            _basesManager     = new BasesManager(_model.Bases);

            _productsDatabase.ProductAdded     += ProductsDatabaseOnProductAdded;
            _productsDatabase.ProductExpired   += OnProductsDatabaseProductExpired;
            _basesManager.DictBaseStateChanged += BasesManagerOnDictBaseStateChanged;

            _buyCommand    = new Common.Mvvm.Command(BuyCommandImpl);
            _demoCommand   = new Common.Mvvm.Command(DemoCommandImpl, false);
            _launchCommand = new Common.Mvvm.Command(LaunchCommandImpl, false);

            _inAppService.ErrorOccurred += InAppServiceOnErrorOccurred;

            Initialize();
        }
コード例 #13
0
        public ProductsCatalogViewModel()
        {
            _productsCatalog   = Mvx.Resolve <IProductsCatalog>();
            _userInteraction   = Mvx.Resolve <IUserInteraction>();
            _parametersManager = Mvx.Resolve <IParametersManager>();
            _settingsManager   = Mvx.Resolve <Common.ISettingsManager>();
            _shortcutManager   = Mvx.Resolve <Common.IShortcutManager>();
            _resourcesProvider = Mvx.Resolve <Common.IResourcesProvider>();


            ProductClickCommand = new Common.Mvvm.Command(ProductClickCommandImpl);
            PinToStartCommand   = new Common.Mvvm.Command(PinToStartCommandImpl, false);


            BackCommand.IsExecutable           = false;
            GotoCatalogCommand.IsExecutable    = false;
            GotoDictionaryCommand.IsExecutable = false;
            GotoHistoryCommand.IsExecutable    = false;
            GotoFavoritesCommand.IsExecutable  = false;


            Initialize();
        }