public object Convert(object value, Type targetType, object parameter, string language)
{
var snap = value as Snap;
if (snap == null) return null;
if (snap.SenderName == null ||
snap.SenderName == App.SnapChatManager.Account.Username)
{
// You sent this!
switch (snap.Status)
{
case SnapStatus.Opened:
return Application.Current.Resources["SentImageSnapOpenedTemplate"];
case SnapStatus.Screenshotted:
return Application.Current.Resources["SentImageSnapScreenshottedTemplate"];
default:
return Application.Current.Resources["SentImageSnapDeliveredTemplate"];
}
}
// You recieved this!
switch (snap.Status)
{
case SnapStatus.Opened:
return Application.Current.Resources["RecievedImageSnapOpenedTemplate"];
default:
return Application.Current.Resources["RecievedImageSnapDeliveredTemplate"];
}
}