Skip to content

Instantly share code, notes, and snippets.

@icebeam7
Created February 19, 2019 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save icebeam7/3a5b302b0d7256c08c07565bb91dda59 to your computer and use it in GitHub Desktop.
Save icebeam7/3a5b302b0d7256c08c07565bb91dda59 to your computer and use it in GitHub Desktop.
WeatherBotv4App - UserAlignmentConverter.cs
using System;
using System.Globalization;
using WeatherBotv4App.Helpers;
using Xamarin.Forms;
namespace WeatherBotv4App.Converters
{
public class UserAlignmentConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var user = value.ToString();
return user == Constants.BotUser
? TextAlignment.End
: TextAlignment.Start;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment