コード例 #1
0
        public ExampleViewModel4()
        {
            IEnumerable <ExampleModel> models = null;

            this.worker         = new BackgroundWorker();
            this.worker.DoWork += (s, e) =>
            {
                IExampleService service = new MockExampleService();
                models = service.FindExampleModels();
            };

            this.worker.RunWorkerCompleted += (s, e) =>
            {
                if (e.Error != null)
                {
                    throw e.Error;
                }
                this.ExampleModels = models;
            };
            this.worker.RunWorkerAsync();
        }
コード例 #2
0
        public ExampleViewModel()
        {
            IExampleService service = new MockExampleService();

            this.ExampleModels = service.FindExampleModels();
        }