private void avatar_drag(ListBoxItem element, TouchDevice touch_device)
{
if (element == null)
return;
item_generic i;
try { i = (item_generic)element.DataContext;}
catch(Exception) {return; }
if (i.Tag == null)
return;
if (list_users)
{
string username_id = "user;" + ((int)i.Tag).ToString() + ";" + i.avatar.Source.ToString() + ";" + (string)i.username.Text;
start_drag(element, username_id, touch_device, i.avatar.Source.Clone());
}
if (list_design_ideas)
{
string idea = "design idea;" + ((int)i.Tag).ToString() + ";" + i.avatar.Source.ToString() + ";" +
(string)i.username.Text + ";" + i.user_desc.Content + ";" + i.desc.Content + ";" +
i.content.Text;
start_drag(element, idea, touch_device, i.avatar.Source.Clone());
}
if (list_comments)
{
string comment = "comment;" + ((int)i.Tag).ToString() + ";" + i.avatar.Source.ToString() + ";" +
(string)i.username.Text + ";" + i.user_desc.Content + ";" + i.desc.Content + ";" +
i.content.Text;
start_drag(element, comment, touch_device, i.avatar.Source.Clone());
}
if (list_activities)
{
string avatar = "";
if (i.avatar.Source != null)
avatar = i.avatar.Source.ToString();
string activity = "activity;" + ((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, activity, touch_device, img);
}
}