private void DrawBoundariesBtn_Click(object sender, RoutedEventArgs e)
 {
     try
     {
         int typeOfBoundary = TypeOfBoundaryCmbBox.SelectedIndex;
         int widthOfBoundary = int.Parse(WidthOfBoundaryTxtBox.Text);
         switch (typeOfBoundary)
         {
             case 0:
                 Boundaries.AllBoundaries(widthOfBoundary, XNumOfCells, YNumOfCells);
                 PaintPane();
                 break;
             case 1:
                 Boundaries.SelectedBoundaries(grain2Edge,widthOfBoundary, XNumOfCells, YNumOfCells);
                 PaintPane();
                 break;
             default:
                 break;
         }
     }
     catch (Exception) { }
 }
 private void ClearWithoutBoundariesBtn_Click(object sender, RoutedEventArgs e)
 {
     Boundaries.ClearSpace(XNumOfCells, YNumOfCells);
     PaintPane();
 }