コード例 #1
0
        public MainPageViewModel(INavigationService navigationService, IAnalyticsService analyticsService, NumberGenerator numberGenerator)
            : base(navigationService)
        {
            Title = "Main Page";

            ChangeNumberCommand = new Command(async() =>
            {
                using (var _ = analyticsService.StartOperation(this, "Generate Number"))
                {
                    analyticsService.Trace(this, "Starting number generation", LogSeverity.Information);
                    Number = await numberGenerator.GenerateAsync();
                }
            });
        }