Jun 25, 2013 at 1:07 PM
Edited Jun 25, 2013 at 2:41 PM
I am working on application which have so-many documents.
So I can't add each and every document in silverlight application.
So what I need, I can read bytes or lines through WCF and send data to silverlight application, now I tried below code, but I am unable to display document in XPS viewer.
/ ------ Service Call ------
Service1Client srvc = new Service1Client();
srvc.GetFileContentCompleted += new EventHandler<GetFileContentCompletedEventArgs>srvc_GetFileContentCompleted);
/ ------ Service Call Completed Event ------
void srvc_GetFileContentCompleted(object sender, GetFileContentCompletedEventArgs e)
Stream sr = new MemoryStream();
sr.Read(e.Result.GetFileContentResult, 0, e.Result.GetFileContentResult.Length);
DataSource.PackageReader = new DefaultPackageReader(sr);
/ ------ WCF service method which read content and return stream ------
public Stream GetFileContent()
string path = @"D:\BharatLeel\PracticeOrSampleApplication\4eDentalUniversitySolution\DentalChartSilverlightApp\Documents\sample.xps";
StreamReader sr = new StreamReader(path);
Please do need full help.
Thanks in Advance.