Seems like XamlReader.Load(Stream stream) closes the stream internally. Question is, does it always do that, regardless of whether there were any exceptions? or simply put, do I need a 'using' statement below? Stream _stream = stream; // using (Stream _stream = stream) { this.Document = (Panel) XamlReader.Load(_stream); // }
Better be safe than sorry :) "Roman" wrote in message news:74E13BF8-EFFA-483F-8047-4CB230F0636B@microsoft.com... > Seems like XamlReader.Load(Stream stream) closes the stream internally. > Question is, does it always do that, regardless of whether there were any > exceptions? > > or simply put, do I need a 'using' statement below? > > Stream _stream = stream; > // using (Stream _stream = stream) { > this.Document = (Panel) XamlReader.Load(_stream); > // } >