Sevki
Sevki

Reputation: 3682

Visual studio tries to run the program within the editor and crashes

I have a WPF projet that uses the WPFMediaKit and I have realised that it runs the camera and even the MessageBox.Show() code when in visual studio editing. That wouldn't be a problem if it was only the camera that it was trying to run its doing some other stuff that crash the instant i go into design view.

Why is this happening and where can it be turned off? Is there some sort of livepreview-off switch?

Upvotes: 1

Views: 121

Answers (2)

Blindy
Blindy

Reputation: 67352

You can't stop it, it's made so user controls can draw themselves and react smartly to the user at design time.

You can however check for the DesignMode property inside your control and not do the camera operations (or anything at all if you wish).

Upvotes: 5

MattDavey
MattDavey

Reputation: 9017

Sounds like a problem with WPFMediaKit itself. It should have been written to take the IsDesignMode property into account as Blindy pointed out...

Upvotes: 0

Related Questions