As stated above, the main issue is knives categorized as "prohibited weapons" – ie springers and gravity knives.
It's an urban myth that any knife under three inches, or whatever, is legal. However, the thing to worry about is that the legal definition of a weapon is:
". . . any thing used, designed to be used or intended for use
(a) in causing death or injury to any person, or
(b) for the purpose of threatening or intimidating any person."
(CCC 46)
Which means a boot knife or stiletto will land you in hot water, or any other knife if you threaten someone with it. Other than that, you will likely have to convince the cop or the court that you have a good purpose for your knife. Mention fishing, hunting, hiking, camping, etc and you'll likely be all right; cite self-defence and you'll be causing trouble for yourself. Note that the former are not typically Downtown activities, so carry a blade that doesn't look too aggressive (I EDC an Opinel No. 8 in Vancouver because it has a wood handle, the blade locks shut and it looks as inoffensive as a knife ever could; and, let's face it, I don't actually need a fixed blade in my office job).
Canadian law is vague – largely because it's based on case law, with little interference from vote-chasing politicians (of any persuasion). This is actually in your favour, if you find yourself up before a judge. A rigid definition of what's illegal, coupled with minimum sentencing requirements, generally means you are screwed.
So it's all about how it works in court, on the day. I've never studied law, but I've sat through hundreds of case over the years as a journalist, so I can only write about what I've seen. And while I've seen many cases in which possession of a knife (or a small amount of pot) has come up, this has always been the lesser item on the charge list – and invariably gets dropped – unless the knife was actually used to commit a crime.
Firstly, it's kinda hard for the prosecution to maintain that you intended to use your knife as a weapon if it was in your pocket at the time. Secondly, you've got to be doing something dumb to get yourself arrested in the first place.
The smaller stuff (knives, a joint or two) either gets plea-bargained away, or else overlooked at sentencing – dropped outright or else made concurrent.
Getting charged with use of a weapon is big trouble – having said that, I once sat through a guy on weapons charges for attacking someone with a pen (he was trying to gouge the other guy's eyes out with it). I covered an armed robbery case in which a knife was used to hold-up restaurants, but then you are on an armed robbery charge if you use an imitation firearm, or even manage to convince people that a banana in a paper bag is a pistol.
On the subject of what happens if you set off a metal detector. . . well, I think it's quite obvious that they ain't going to let you into the building with your knife, otherwise they wouldn't bother with all that fancy equipment. Having said that, I once got two chopsticks confiscated when my bag was searched entering Vancouver Provincial Court (and no, I had no idea I had them, let alone why I had them) but then the Sheriff's Officer was doing his best to stop me taking my bag into the building and doing everything in his power to make things hard for me.
Sorry if I've written too much here.