'宣言 Public Property SmallImage As ImageSource
public ImageSource SmallImage {get; set;}
Private Sub Button_Click(sender As Object, e As RoutedEventArgs) Dim group As OutlookBarGroup = xamOutlookBar1.Groups("Group1") If group IsNot Nothing Then group.IsSelected = True End If End Sub Private Sub Button_Click_1(sender As Object, e As RoutedEventArgs) Dim group As New OutlookBarGroup() group.SmallImage = New BitmapImage(New Uri("pack://application:,,,/32x32.png")) group.Header = "New Group" System.Diagnostics.Debug.WriteLine(group.Header + ".Location is " + group.Location) xamOutlookBar1.Groups.Add(group) System.Diagnostics.Debug.WriteLine(group.Header + ".Location is " + group.Location) End Sub
private void Button_Click(object sender, RoutedEventArgs e) { OutlookBarGroup group= xamOutlookBar1.Groups["Group1"]; if (group != null) { group.IsSelected = true; } } private void Button_Click_1(object sender, RoutedEventArgs e) { OutlookBarGroup group = new OutlookBarGroup(); group.SmallImage= new BitmapImage(new Uri("pack://application:,,,/32x32.png")); group.Header = "New Group"; System.Diagnostics.Debug.WriteLine(group.Header + ".Location is " + group.Location); xamOutlookBar1.Groups.Add(group); System.Diagnostics.Debug.WriteLine(group.Header + ".Location is " + group.Location); }