Exemplo n.º 1
0
        public MainPage()
        {
            this.InitializeComponent();
            action.Click += async(s, e) =>
            {
                var syncResponse = Caller <Service.Contract.IServiceContract> .Call(service => service.GetInt());

                AddResultToDisplay(syncResponse);

                var asyncResponse = await Caller <Service.Contract.IServiceContract> .CallAsync(service => service.GetInt());

                AddResultToDisplay(asyncResponse);

                var syncItem = Caller <Service.Contract.IServiceContract> .Call(service => service.GetItem("Item Name", 5));

                AddResultToDisplay(syncItem.Name);

                var asyncItem = await Caller <Service.Contract.IServiceContract> .CallAsync(service => service.GetItem("Async Item Name", 5));

                AddResultToDisplay(asyncItem.Name);
            };
        }