A state-dependent switching law that obeys a dwell-time constraint and guarantees the stability of a switched linear system is designed. Sufficient conditions are obtained for the stability of the switched systems when the switching law is applied in presence of polytopic-type parameter uncertainty. A Lyapunov function, in quadratic form, is assigned to each subsystem such that it is nonincreasing at the switching instants. During the dwell time, this function varies piecewise linearly in time. After the dwell, the system switches if the switching results in a decrease in the value of the LF. The proposed method is applicable also to robust stabilization via state feedback. It is further extended to guarantee a bound on the L2 -gain of the switching system and it is also used in deriving state-feedback control law that robustly achieves a prescribed L2-gain bound.