async void tweet()
		{
			DismissViewController (true, null);

			var tvc = new MonoTouch.Twitter.TWTweetComposeViewController();
			var products = await WebService.Shared.GetProducts();
			if(products.Count > 0){
				products.Shuffle ();

				var imageUrl = products.First ().ImageUrl;
				var imagePath = await FileCache.Download (imageUrl);
				tvc.AddImage (UIImage.FromFile (imagePath));
			}
			tvc.AddUrl (NSUrl.FromString("http://xamarin.com/sharp-shirt"));
			tvc.SetInitialText("I just built a native iOS app with C# using #Xamarin and all I got was this free C# t-shirt!");
			PresentViewController(tvc, true,null);
		}
Пример #2
0
        async void tweet()
        {
            DismissViewController(true, null);

            var tvc      = new MonoTouch.Twitter.TWTweetComposeViewController();
            var products = await WebService.Shared.GetProducts();

            if (products.Count > 0)
            {
                products.Shuffle();

                var imageUrl  = products.First().ImageUrl;
                var imagePath = await FileCache.Download(imageUrl);

                tvc.AddImage(UIImage.FromFile(imagePath));
            }
            tvc.AddUrl(NSUrl.FromString("http://xamarin.com/sharp-shirt"));
            tvc.SetInitialText("I just built a native iOS app with C# using #Xamarin and all I got was this free C# t-shirt!");
            PresentViewController(tvc, true, null);
        }