Hi,
I am adding groups in code behind and when I set the .IsSelected for a group, it is not the one selected when the bar completes loading. Why is that.? Here is the code to add the group
OutlookBarGroup xam = new OutlookBarGroup();xam.Header = bg.BuddyGroupName.ToString();if (grp.isDefault){ xam.IsSelected = true; xam.Visibility = Visibility.Visible;}else{ xam.IsSelected = false;}ListBox lb = new ListBox();lb.MouseDoubleClick += new MouseButtonEventHandler(lb_MouseDoubleClick);foreach (string ct in grp.list){ lb.Items.Add(ct.UserName.ToString()); xam.Content = lb;}xamOutlookBar1.Groups.Add(xam);
Try to add a group before setting IsSelected:
OutlookBarGroup xam = new OutlookBarGroup();
xamOutlookBar1.Groups.Add(xam);xam.Header = bg.BuddyGroupName.ToString();if (grp.isDefault){ xam.IsSelected = true; xam.Visibility = Visibility.Visible;}
Hope this helps