C# 阵列计数器不工作

C# 阵列计数器不工作,c#,wpf,C#,Wpf,我正在尝试使用屏幕上的图像数组制作计数器,3秒钟后,图像应该消失,但它们不会消失,我正在删除deleteMole()中的图像,并在createImage()中创建和命名图像 有什么帮助吗 uint[] CounterArray; // Change Image from "Hut" to Mole \\ private void ChangeImage() { int NumberofImages = Convert.ToInt32(NumofImages); MoleList

我正在尝试使用屏幕上的图像数组制作计数器,3秒钟后,图像应该消失,但它们不会消失,我正在删除deleteMole()中的图像,并在createImage()中创建和命名图像

有什么帮助吗

uint[] CounterArray;

// Change Image from "Hut" to Mole \\
private void ChangeImage()
{
    int NumberofImages = Convert.ToInt32(NumofImages);
    MoleList = new uint[NumberofImages];
    string Moleimage = TUtils.GetIniFileString(Moleini, "ImagePath", "PictureFile", Root + "mole2.png");

    if (NameCount == NumberofImages)
        NameCount = -1;

    NameCount++;

    Image newImage = HoleImage();

    molePopup = MoleImage();

        Image mole = new Image();

        Grid.SetColumn(mole, ranCol);
        Grid.SetRow(mole, ranRow);
        grid_Main.Children.Add(mole);

        for (NameCount = 0; NameCount < NumofImages; NameCount++)
        {
            CounterArray = new uint[3];
        }

    //Calling MoileLifeCounter for Mole Death
        moleLifeCounter();

        mole.MouseUp += new MouseButtonEventHandler((o, e) =>
            {
                grid_Main.Children.Remove(mole);
                MolePoints++;
            });
}

//Make Mole Disapear 
private void deleteMole()
{

    NumofImages = TUtils.GetIniInt(Moleini, "NumPictures", "pictures", 8);
    NumberofImages = Convert.ToInt32(NumofImages);

    for (int j = 0; j < NumofImages; j++)
    {

        CounterArray[j]--;

        if (CounterArray[j] == 0)
        {

//Delete Image
        }

        else
        {

            break;
        }

    }

}
uint[]计数器数组;
//将图像从“小屋”更改为“鼹鼠”\\
私有void ChangeImage()
{
int NumberofImages=Convert.ToInt32(NumofImages);
分子量=新的单位[图像数];
字符串Moleimage=TUtils.GetIniFileString(Moleini,“ImagePath”,“PictureFile”,Root+“mole2.png”);
if(NameCount==NumberofImages)
名称计数=-1;
NameCount++;
Image newImage=HoleImage();
molePopup=MoleImage();
图像摩尔=新图像();
网格设置柱(摩尔、兰科尔);
网格。SetRow(摩尔,兰罗);
网格_Main.Children.Add(摩尔);
对于(NameCount=0;NameCount
{
主格栅。儿童。移除(鼹鼠);
分子点++;
});
}
//做梨
私有void deleteMole()
{
NumofImages=TUtils.getinint(Moleini,“NumPictures”,“pictures”,8);
NumberofImages=Convert.ToInt32(NumofImages);
对于(int j=0;j

}

你能减少再现问题和发布问题所需的代码量吗?是的,当然,但大部分都是相关的。@RyanGates刚刚从中删除了一些代码。