Trying to rotate a model while a new UI Button is held down?

I’ve been trying to find a way to use the new UI in a similar way to the old repeat button, but so far this code just freezes unity while buttonPressed = true instead of incrementing the models rotation every frame like I would expect. Any help would be appreciated.

public void RotateModel(string XYZ)
    {
        while (buttonPressed)
        {
            if (XYZ == "x")
            {
                if (button.tag.Equals("Plus"))
                {
                    model.transform.Rotate(x += .25f, 0, 0);
                }
                if (button.tag.Equals("Minus"))
                {
                    model.transform.Rotate(x -= .25f, 0, 0);
                }
            }

I uploaded a scene for you - check if it is what you’re looking for and let me know