Example 10 As shown in Figure $22-2$, the side length of the large equilateral triangle is 3, and the number of parallelograms formed by the lines passing through each grid point in the figure is $f(3)=15$. In the general case, find the number of corresponding parallelograms $f(n)$ in a triangle with a side length of $n$.
Solution: Let the number of parallelograms whose sides are parallel to the sides $AB, BC$ of $\triangle ABC$ (with side length $n$) be $g(n)$.

On the extensions of $BA, BC$, take points $E, F$ respectively such that $BE = BF = n+1$, then $EF = n+1$, and each side of the above parallelograms intersects $EF$ at exactly one point. These four points are distinct and are lattice points on $EF$ (i.e., the points that divide $EF$ into $n+1$ equal segments).
Conversely, from the $n+2$ lattice points on $EF$ (including $E, F$), any four points can be chosen. Draw lines parallel to $AB$ through the two points closer to $E$, and draw lines parallel to $BC$ through the other two points, and a parallelogram of the above type can be obtained. Therefore, $g(n) = C_{n+2}^{4}$, and thus $f(n) = 3 \times g(n) = 3 C_{n+2}^{4}$.