  An integral PBW-basis of type $A_1^{(1)}$ has been constructed by Zhang [Z]
and Chen [C] using the Auslander-Reiten quiver of the Kronecker quiver. We
associate a geometric order to elements in this basis following an idea of
Lusztig [L1] in the case of finite type. This leads to an algebraic realization
of a bar-invariant basis of $\uq2$. For any affine symmetric type, we obtain an
integral PBW-basis of the generic composition algebra, by using an algebraic
construction of the integral basis for a tube in [DDX], an embedding of the
module category of the Kronecker quiver into the module category of the tame
quiver, and a list of the root vectors of indecomposable modules according to
the preprojective, regular, and preinjective components of the Auslander-Reiten
quiver of the tame quiver. When the basis elements are ordered to be compatible
with the geometric order given by the dimensions of the orbit varieties and the
extension varieties, we can show that the transition matrix between the
PBW-basis and a monomial basis is triangular with diagonal entries equal to 1.
Therefore we obtain a bar-invariant basis. By a orthogonalization for the
PBW-basis with the inner product, we finally give an algebraic way to realize
the canonical bases of the quantized enveloping algebras of all symmetric
affine Kac-Moody Lie algebras.
