public RearangeMovesWindow(IPokemon pokemon) { InitializeComponent(); this.pokemon = pokemon; ContextMenu contextMenu = new ContextMenu(); MenuItem delete = new MenuItem(); delete.Header = "Delete Move"; delete.Click += OnDeleteMove; delete.IsEnabled = pokemon.NumMoves > 1; contextMenu.Items.Add(delete); moves = new ObservableCollection<ListViewItem>(); for (int i = 0; i < pokemon.NumMoves; i++) { Move move = pokemon.GetMoveAt(i); ListViewItem listViewItem = new ListViewItem(); Grid grid = new Grid(); grid.Width = 321; grid.Height = 27; Rectangle panel = new Rectangle(); panel.Margin = new Thickness(1, 1, 0, 0); panel.Width = 319; panel.Height = 23; panel.RadiusX = 2; panel.RadiusY = 2; panel.Fill = new SolidColorBrush(Color.FromRgb(248, 248, 248)); panel.Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0)); panel.StrokeThickness = 1; PokemonTypeControl type = new PokemonTypeControl(); type.Type = move.MoveData.Type; type.Margin = new Thickness(10, 4, 0, 0); ConditionTypeControl condition = new ConditionTypeControl(); condition.Type = move.MoveData.ConditionType; condition.Margin = new Thickness(10, 4, 0, 0); condition.Visibility = Visibility.Hidden; Label name = new Label(); name.Content = move.MoveData.Name; name.Margin = new Thickness(120, 0, 0, 0); name.FontWeight = FontWeights.Bold; Label pp = new Label(); pp.Content = (move.MoveData.PP == 0 ? "--" : move.TotalPP.ToString()); pp.Margin = new Thickness(281, 0, 0, 0); pp.FontWeight = FontWeights.Bold; grid.Children.Add(panel); grid.Children.Add(type); grid.Children.Add(condition); grid.Children.Add(name); grid.Children.Add(pp); listViewItem.Content = grid; listViewItem.Tag = move; moves.Add(listViewItem); listViewItem.ContextMenu = contextMenu; } listViewMoves.ItemsSource = moves; dropManager = new ListViewDragDropManager<ListViewItem>(listViewMoves); this.labelMoveAccuracy.Content = ""; this.labelMovePower.Content = ""; this.labelMoveCategory.Content = ""; this.labelMoveAppeal.Content = ""; this.labelMoveJam.Content = ""; this.textBlockMoveDescription.Text = ""; buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden; }
public LearnMoveWindow(IPokemon pokemon, ushort moveID) { InitializeComponent(); this.pokemon = pokemon; this.newMoveID = moveID; for (int i = 0; i < 5; i++) { Move move; if (i == 4) { listViewMoves.Items.Add(new Separator()); move = new Move(newMoveID, 0, 0); move.PP = move.TotalPP; ListViewItem newName = new ListViewItem(); newName.Content = "New Move"; newName.IsHitTestVisible = false; newName.FontWeight = FontWeights.Bold; listViewMoves.Items.Add(newName); } else { move = pokemon.GetMoveAt(i); } ListViewItem listViewItem = new ListViewItem(); Grid grid = new Grid(); grid.Width = 321; grid.Height = 27; Rectangle panel = new Rectangle(); panel.Margin = new Thickness(1, 1, 0, 0); panel.Width = 319; panel.Height = 23; panel.RadiusX = 2; panel.RadiusY = 2; panel.Fill = new SolidColorBrush(Color.FromRgb(248, 248, 248)); panel.Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0)); panel.StrokeThickness = 1; PokemonTypeControl type = new PokemonTypeControl(); type.Type = move.MoveData.Type; type.Margin = new Thickness(10, 4, 0, 0); ConditionTypeControl condition = new ConditionTypeControl(); condition.Type = move.MoveData.ConditionType; condition.Margin = new Thickness(10, 4, 0, 0); condition.Visibility = Visibility.Hidden; Label name = new Label(); name.Content = move.MoveData.Name; name.Margin = new Thickness(120, 0, 0, 0); name.FontWeight = FontWeights.Bold; Label pp = new Label(); pp.Content = (move.MoveData.PP == 0 ? "--" : move.TotalPP.ToString()); pp.Margin = new Thickness(281, 0, 0, 0); pp.FontWeight = FontWeights.Bold; grid.Children.Add(panel); grid.Children.Add(type); grid.Children.Add(condition); grid.Children.Add(name); grid.Children.Add(pp); listViewItem.Content = grid; listViewItem.Tag = move; listViewMoves.Items.Add(listViewItem); } this.labelMoveAccuracy.Content = ""; this.labelMovePower.Content = ""; this.labelMoveCategory.Content = ""; this.labelMoveAppeal.Content = ""; this.labelMoveJam.Content = ""; this.textBlockMoveDescription.Text = ""; buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden; }
public RearangeMovesWindow(IPokemon pokemon) { InitializeComponent(); this.pokemon = pokemon; ContextMenu contextMenu = new ContextMenu(); MenuItem delete = new MenuItem(); delete.Header = "Delete Move"; delete.Click += OnDeleteMove; delete.IsEnabled = pokemon.NumMoves > 1; contextMenu.Items.Add(delete); moves = new ObservableCollection <ListViewItem>(); for (int i = 0; i < pokemon.NumMoves; i++) { Move move = pokemon.GetMoveAt(i); ListViewItem listViewItem = new ListViewItem(); Grid grid = new Grid(); grid.Width = 321; grid.Height = 27; Rectangle panel = new Rectangle(); panel.Margin = new Thickness(1, 1, 0, 0); panel.Width = 319; panel.Height = 23; panel.RadiusX = 2; panel.RadiusY = 2; panel.Fill = new SolidColorBrush(Color.FromRgb(248, 248, 248)); panel.Stroke = new SolidColorBrush(Color.FromRgb(0, 0, 0)); panel.StrokeThickness = 1; PokemonTypeControl type = new PokemonTypeControl(); type.Type = move.MoveData.Type; type.Margin = new Thickness(10, 4, 0, 0); ConditionTypeControl condition = new ConditionTypeControl(); condition.Type = move.MoveData.ConditionType; condition.Margin = new Thickness(10, 4, 0, 0); condition.Visibility = Visibility.Hidden; Label name = new Label(); name.Content = move.MoveData.Name; name.Margin = new Thickness(120, 0, 0, 0); name.FontWeight = FontWeights.Bold; Label pp = new Label(); pp.Content = (move.MoveData.PP == 0 ? "--" : move.TotalPP.ToString()); pp.Margin = new Thickness(281, 0, 0, 0); pp.FontWeight = FontWeights.Bold; grid.Children.Add(panel); grid.Children.Add(type); grid.Children.Add(condition); grid.Children.Add(name); grid.Children.Add(pp); listViewItem.Content = grid; listViewItem.Tag = move; moves.Add(listViewItem); listViewItem.ContextMenu = contextMenu; } listViewMoves.ItemsSource = moves; dropManager = new ListViewDragDropManager <ListViewItem>(listViewMoves); this.labelMoveAccuracy.Content = ""; this.labelMovePower.Content = ""; this.labelMoveCategory.Content = ""; this.labelMoveAppeal.Content = ""; this.labelMoveJam.Content = ""; this.textBlockMoveDescription.Text = ""; buttonOpenMoveInBulbapedia.Visibility = Visibility.Hidden; }