本文整理汇总了C#中Xamarin.GetShareUI方法的典型用法代码示例。如果您正苦于以下问题:C# Xamarin.GetShareUI方法的具体用法?C# Xamarin.GetShareUI怎么用?C# Xamarin.GetShareUI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Xamarin
的用法示例。
在下文中一共展示了Xamarin.GetShareUI方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Sharing
void Sharing(Xamarin.Social.Service service, Button shareButton)
{
Item item = new Item {
Text = "I'm sharing great things using Xamarin!"
};
Intent intent = service.GetShareUI (this, item, shareResult => {
shareButton.Text = service.Title + " shared: " + shareResult;
});
StartActivity (intent);
}
示例2: Share
void Share (Xamarin.Social.Service service)
{
if (fileName == string.Empty || fileName == "in-progress")
return;
// 2. Create an item to share
var text = "Xamarin.SoMA ... Social Mobile & Auth! ";
if (shareItem != null) { // use the existing one passed to the activity
text = shareItem.Text;
fileName = shareItem.ImagePath;
location = shareItem.Location;
}
var item = new Item { Text = text };
item.Images.Add (new ImageData (fileName));
if (isLocationSet)
item.Links.Add (new Uri ( "https://maps.google.com/maps?q=" + location));
// 3. Present the UI on Android
var shareIntent = service.GetShareUI (this, item, result => {
// result lets you know if the user shared the item or canceled
if (result == ShareResult.Cancelled)
return;
Console.WriteLine ("{0} shared", service.Title);
// 4. Now save to the database for the MainScreen list
var si = new ShareItem {
Text = item.Text, // get the edited text from the share UI
ImagePath = fileName,
Location = location
};
if (item.Links.Count > 0) si.Link = item.Links[0].AbsoluteUri;
si.SocialType = service.Title;
App.Database.SaveItem(si);
shareItem = si; // replace the one in the activity
});
StartActivity (shareIntent);
}
示例3: Share
//Evento de publicacion Estado
void Share (Xamarin.Social.Service service, string textshare)
{
Item item = new Item {
Text = textshare,
};
Intent intent = service.GetShareUI (this, item, shareResult => {
RunOnUiThread(()=>{
Toast.MakeText(this, shareResult.ToString(), ToastLength.Short).Show();
});
});
StartActivity (intent);
}
示例4: ShareImage
//Evento de publicacion Fotografia
void ShareImage (Xamarin.Social.Service service, string textshare)
{
Item item = new Item {
Text = textshare,
};
item.Images.Add(new ImageData(BitmapFactory.DecodeFile(_Archivo.AbsoluteFile.ToString())));
Intent intent = service.GetShareUI (this, item, shareResult => {
RunOnUiThread(()=>{
Toast.MakeText(this, shareResult.ToString(), ToastLength.Short).Show();
});
});
StartActivity (intent);
}
示例5: ShareLink
//Evento de publicacion Estado+Link
void ShareLink (Xamarin.Social.Service service, string textshare)
{
Item item = new Item {
Text = textshare,
Links = new List<Uri> {
new Uri ("http://alejandroruizvarela.blogspot.mx/"),
},
};
Intent intent = service.GetShareUI (this, item, shareResult => {
RunOnUiThread(()=>{
Toast.MakeText(this, shareResult.ToString(), ToastLength.Short).Show();
});
});
StartActivity (intent);
}