コード例 #1
0
        /// <summary>
        /// Appearing event handler
        /// </summary>
        protected override async void OnAppearing()
        {
            base.OnAppearing();

            this.speech = ((App)App.Current).Container.Resolve <ITextSpeechService>();
            await this.translate.InitializeAsync();

            await this.Refresh();
        }
コード例 #2
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="logger">ログ出力サービス(DI コンテナにより自動注入される)</param>
        /// <param name="repository">リポジトリ(DI コンテナにより自動注入される)</param>
        /// <param name="speechService">文字列読み上げサービス(DI コンテナにより自動注入される)</param>
        public TopPageViewModel(ILogger logger, IPhotoRepository repository, ITextSpeechService speechService)
        {
            this.logger = logger;
            this.logger.WriteLog("ctor");

            this.repository = repository;
            this.repository.Load();

            this.Items.Clear();
            foreach (var photo in this.repository.Items)
            {
                this.Items.Add(photo);
            }

            this.speechService = speechService;
        }