This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (activity.Attachments?.Count() > 0) | |
{ | |
var imageCount = activity.Attachments.Count(a => a.ContentType.Contains("image")); | |
if (imageCount > 0) | |
{ | |
// Notify user that we got something | |
var message = imageCount == 1 ? $"You've sent 1 image" : $"You've sent {imageCount} images"; | |
var imageReply = activity.CreateReply(message); | |
await connector.Conversations.ReplyToActivityAsync(imageReply); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
byte[] imageBytes = null; | |
// For Skype we need to get an OAuth token to access the content url | |
if (activity.ChannelId.ToLower() == "skype") | |
{ | |
using (var httpClient = new HttpClient()) | |
{ | |
// Request OAuth token | |
var formValues = new KeyValuePair<string, string>[] | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var imageCount = activity.Attachments.Count(a => a.ContentType.Contains("image")); | |
if (imageCount > 0) | |
{ | |
// Notify user that we got something | |
var message = imageCount == 1 ? $"You've sent 1 image" : $"You've sent {imageCount} images"; | |
var imageReply = activity.CreateReply(message); | |
await connector.Conversations.ReplyToActivityAsync(imageReply); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:EmbedNativeAwesomeness" | |
xmlns:ios="clr-namespace:UIKit;assembly=Xamarin.iOS;targetPlatform=iOS" | |
x:Class="EmbedNativeAwesomeness.EmbedNativeAwesomenessPage"> | |
<StackLayout VerticalOptions="Center" HorizontalOptions="Center"> | |
<Label Text="Isn't this awesome?!" VerticalOptions="Center" HorizontalOptions="Center" /> | |
<ios:UIDatePicker /> | |
<ios:UISlider /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:EmbedNativeAwesomeness" | |
xmlns:ios="clr-namespace:UIKit;assembly=Xamarin.iOS;targetPlatform=iOS" | |
x:Class="EmbedNativeAwesomeness.EmbedNativeAwesomenessPage"> | |
<StackLayout VerticalOptions="Center" HorizontalOptions="Center"> | |
<Label Text="Isn't this awesome?!" VerticalOptions="Center" HorizontalOptions="Center" /> | |
<ios:UIDatePicker /> | |
<ios:UISlider MaxValue="10" Value="{Binding SlideValue}" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class UiRedTintSwitch : UISwitch | |
{ | |
public UiRedTintSwitch () | |
{ | |
OnTintColor = UIColor.Red; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" | |
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | |
xmlns:local="clr-namespace:EmbedNativeAwesomeness" | |
xmlns:ios="clr-namespace:UIKit;assembly=Xamarin.iOS;targetPlatform=iOS" | |
xmlns:ioscustom="clr-namespace:EmbedNativeAwesomeness.iOS;assembly=EmbedNativeAwesomeness.iOS;targetPlatform=iOS" | |
x:Class="EmbedNativeAwesomeness.EmbedNativeAwesomenessPage"> | |
<StackLayout VerticalOptions="Center" HorizontalOptions="Center"> | |
<Label Text="Isn't this awesome?!" VerticalOptions="Center" HorizontalOptions="Center" /> | |
<ios:UIDatePicker /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using EffectsSample.iOS; | |
using UIKit; | |
using Xamarin.Forms; | |
using Xamarin.Forms.Platform.iOS; | |
[assembly: ResolutionGroupName ("MyCompany")] | |
[assembly: ExportEffect (typeof (SwitchEffect), "SwitchEffect")] | |
namespace EffectsSample.iOS | |
{ | |
public class SwitchEffect : PlatformEffect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Xamarin.Forms; | |
namespace EffectsSample | |
{ | |
public class SwitchEffect : RoutingEffect | |
{ | |
public SwitchEffect () : base ("MyCompany.SwitchEffect") | |
{ | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:EffectsSample" x:Class="EffectsSample.EffectsSamplePage"> | |
<Switch VerticalOptions="Center" HorizontalOptions="Center"> | |
<Switch.Effects> | |
<local:SwitchEffect /> | |
</Switch.Effects> | |
</Switch> | |
</ContentPage> |
OlderNewer