Example #1
0
        Team team;       //Reference to the team that holds the equipment

        //Default constructor, takes in the specific information that is necessary to the existence of this object.
        public EquipmentIcon(Team relatedTeam, TeamInfoPage teamInfoPage, int size, Equipment relatedEquipment) : base()
        {
            this.Width                 = size;
            this.Height                = size;
            this.FlowDirection         = FlowDirection.LeftToRight;
            this.MouseRightButtonDown += new MouseButtonEventHandler(teamInfoPage.RemoveTeamEquipment);
            this.equip                 = relatedEquipment;
            this.team = relatedTeam;
        }
 //handling changing frame index position up, if at top, goes to bottom position instead
 internal void FrameMoveUp(UIElement element)
 {
     count = StackPanel_teamList.Children.Count;             //get number of elements in stackpanel
     if (StackPanel_teamList.Children.Contains(element))
     {
         index = StackPanel_teamList.Children.IndexOf(element);
         if (index > 0)
         {
             elementIndex = index - 1;
             StackPanel_teamList.Children.Remove(element);
             StackPanel_teamList.Children.Insert(elementIndex, element);
             Frame        teamFrame = (Frame)(StackPanel_teamList.Children[elementIndex]);
             TeamInfoPage teamInfo  = (TeamInfoPage)teamFrame.Content;
             Team         team      = teamInfo.getTeam();
             Team.Swap(team, "up");
         }
         else if (index == 0)
         {
         }
     }
 }