private void InitializePiePieces() { var generalVol = Scopes.TotalSum; var genAngle = 0.0; int amount = 0; for (int i = 0; i < Scopes.Count(); i++) { if (Scopes[i].Sum != 0) { var angle = Convert.ToDouble((Scopes[i].Sum * FullAngle) / generalVol); var piePiece = new PiePiece(amount, i, angle, UsersBrushes[amount]); amount++; piePiece.MouseIn += PiePiece_MouseIn; piePiece.MouseOut += PiePiece_MouseOut; piePiece.Rotate(genAngle); genAngle += angle; piePieces.Add(piePiece); PiecesGrid.Children.Add(piePiece); } } }
private void PiePiece_MouseOut(PiePiece sender) { Panel.SetZIndex(sender, ElementToBachgroundIndex); ShowGeneralInfo(); }