private void avatar_drag(ListBoxItem element, TouchDevice touch_device)
{
if (element == null)
return;
item_generic i;
try { i = (item_generic)element.DataContext; }
catch (Exception)
{
Image i2;
try { i2 = (Image)element.DataContext; }
catch (Exception) { return; }
if (i2.Tag == null) return;
collection_item item = (collection_item)i2.Tag;
if (i2.Source != null)
start_drag(element, item, touch_device, i2.Source.Clone());
return;
}
if (i.Tag == null)
return;
string avatar = "";
if (i.avatar.Source != null)
avatar = i.avatar.Source.ToString();
string data = drag_prefix + ";" + ((int)i.Tag).ToString() + ";" + avatar + ";" +
(string)i.username.Text + ";" + i.user_desc.Content + ";" + i.desc.Content + ";" + i.content.Text;
ImageSource img = null;
if (i.avatar.Source != null)
img = i.avatar.Source.Clone();
start_drag(element, data, touch_device, img);
}