public void list_users_and_highlight(string username, bool highlight, TabControl tb)
{
this.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
new System.Action(() =>
{
if (highlight)
{
tb.SelectedIndex = 0;
this.users_list.populator.item_width = this.Width - 3;
this.users_list.populator.list_all_users_sync();
//configurations.SortItemGenericList(this.users_list._list.Items, false, false, true, configurations.users_num_desc.Length, configurations.users_date_desc.Length, true, true);
//this.header.atoz.IsChecked = false;
//this.header.recent.IsChecked = true;
//this.header.top.IsChecked = false;
//this.users_list._list.Items.Refresh();
//this.users_list._list.UpdateLayout();
}
item_generic_v2 i = find_item(username);
if (i == null) return;
ListBoxItem lbi = (ListBoxItem)(this.users_list._list.ItemContainerGenerator.ContainerFromItem(i));
if (highlight)
{
this.users_list._list.ScrollToCenterOfView(i);
i.Background = Brushes.Gray;
//double y = lbi.TransformToAncestor(Application.Current.MainWindow).Transform(new Point(0, 0)).Y;
double x = 0;
if (this.users_list._list.Tag != null)
x = (double)this.users_list._list.Tag;
window_manager.open_collection_window((string)i.title.Text, (int)i.Tag, 65, x + 30);//lbi.PointToScreen(new Point(0,0)).Y);
}
else
i.Background = Brushes.White;
}));
}