private void listTags_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (listTags.SelectedItem != null) { var tag = listTags.SelectedItem as ExtractedTag; if (tag == null) { return; } string newName = MetroInputBox.Show("Rename Tag", "Please enter a new name for the tag.", tag.Name, "Enter a tag name."); if (newName == null || newName == tag.Name) { return; } // Set the name tag.Name = newName; // Update UI listTags.Items.Refresh(); } }
private void BtnAddMore_OnClick(object sender, RoutedEventArgs e) { var deltaStr = MetroInputBox.Show("Tag Block Reallocator - Assembly", "Enter the number of elements to add to the block.\nEntering a negative number will remove elements from the end of the block.\nHexadecimal values starting with \"0x\" are allowed.", "", "Enter a number.", "^-?(0x[0-9a-f]+|[0-9]+)$"); if (string.IsNullOrEmpty(deltaStr)) { return; } int delta; if (TryParseDeltaString(deltaStr, out delta)) { AddToCount(delta); } }