R. v. MacMillan, 2013 ONCA 109 has a useful passage on the meaning of detention and when detention commences:
As is made clear in R. v. Suberu, 2009 SCC 33,  2 S.C.R. 460, at para. 23, even where a person is under investigation for criminal activity and is asked questions, the person is not necessarily detained. In the absence of a legal obligation to comply, detention arises where a reasonable person would conclude by reason of the state conduct that he or she had no choice but to comply.