private void btnAddItem_Click(object sender, RoutedEventArgs e) { CustomIntellisenseItem item = new CustomIntellisenseItem(); IntellisenseItemProperties properties = new IntellisenseItemProperties(); properties.DataContext = item; properties.ShowDialog(); if (item.Text != null && item.Text.Trim() != string.Empty) { customItems.Add(item); } }
/// <summary> /// Method to execute add intellisense items /// </summary> /// <param name="param">Specifies the object parameter</param> private void ExecuteAddItemCommand(object param) { IntellisenseItemProperties properties = new IntellisenseItemProperties(); properties.ShowDialog(); string item = properties.text.Text; string icon = properties.txtIcon.Text; if (item != null && item.Trim() != string.Empty) { customItems.Add(new CustomIntellisenseItem() { Text = item, Icon = new BitmapImage(new Uri(icon, UriKind.RelativeOrAbsolute)) }); } }