- Home
- Forum
- Silverlight
- Trying to load saved diagram xaml file into diagram control not working
Trying to load saved diagram xaml file into diagram control not working
I'm having an issue with the DiagramControl's Load() method. I'm trying to load in a saved xaml file created by the Diagram control's Save() call. The file is located in a folder within my Silverlight project. I've tried to load the file the following ways, both of which have failed (the Load method without parameters works fine however):
First way:
Second way:
diagramControl.Load("/PlayerProject;component/test2.xaml");
Thanks,
Hi Chase Novack,
We are analyzing your requirement "load the saved xaml file directly". We will update with you on Wednesday August 20th ,2014.
Please let us know if you have any concerns.
Regards,
MohanaPriya R
Any updates regarding this issue yet?
Thanks,
Chase
Hi Chase,
Regarding “To Load saved xaml file in Silverlight”, your requirement has been achieved by using GetResourceStream() method to load the saved xaml file from the Project Folder. We have created simple sample to meet your requirement. Please refer to the sample from the Attached file.
Note: To load already saved xaml file from
Project folder, please change BuildAction property to Resource (using Properties)
Sample
Details:
We have used two buttons labelled as
“Save” to serialize the current diagram page and “Load” to deserialize the
already saved xaml file in the resource.
Please let us know if you have any
concerns.
Regards,
Saranya C
Attachment: 117109_14d150c4.zip
Attachment: TestProject_67f16982.zip
Hi Chase,
Regarding “Trying to load
saved diagram xaml file into diagram control not working” to you reported
scenario, we have modified your given sample in mainpage.xaml. Please refer to
the attached sample.
Please let us know if you have any concerns.
Regards,
Saranya C
Attachment: TestProject_32d03bd0.zip
The test project you linked worked as expected, but we still cannot get our actual project to work. What changes did you make to the project we linked you in order to get the latest one working?
Thanks,
Hi Chase,
Sorry for the inconvinence caused.
Regarding “Trying to load saved diagram xaml file into diagram control not working”, we have analyzed your attached sample and modified to meet your requirement.
Problem with your sample:
We have referred your “MainPage.xaml” file, you have missed to add the model and view to the DiagramControl. Please refer to the following code snippet and comments.
<Grid x:Name="LayoutRoot" Background="White"> <!--Here, you are not using model and view in DigarmControl so that you are not able to render the node while save and load--> <Syncfusion:DiagramControl Name="dc" BorderBrush="Black" BorderThickness="1" Background="White"HorizontalAlignment="Left" Height="300" VerticalAlignment="Top" Width="400"/> <Button Content="Load" Click="Button_Click" Width="120" Height="30" /> </Grid> |
We have provided video to notify changes made in the sample. Please refer to the attached video.
Please refer to the following online help documentation link for more information about Diagram.
Link: http://help.syncfusion.com/ug/silverlight/documents/addingthroughxaml.htm
Please let us know if you have any concerns.
Regards,
Saranya C
Attachment: TestProjectsVideo_6e4439df.zip
Thanks for getting back to me so quickly. I see the lack of diagram model and view you mentioned in the test project we sent you, but our actual project does have a diagram view and diagram model in the XAML, and yet still doesn't work. We do use RIA services and entity framework for our database communication. Could that maybe be causing this issue in our actual project?
Thanks,
Hi Chase,
We are working on your requirement, we will update
you with the task status on tomorrow September 11, 2014.
Please let us know if you have any concerns.
Regards,
Saranya C
Hi Chase,
Regarding “RIA services and entity framework for our database communication
causing this issue in our actual project?” to you reported query, we suspect that RIA services will
not affect your original project while Load() the already save xaml file. It
could be better for us if you provide sample/video to meet your requirement.
Please let us know
if you have any concerns.
Regards,
Saranya C
Thanks,
Attachment: TestProject_32d03bd0_cbb8f934.zip
Hi Chase,
We are working on your requirement. We will update
you with the task status on tomorrow September 16th, 2014.
Please let us know if you have any concerns.
Regards,
Saranya C
Hi Chase,
Regarding “To load diagram on page
without using button click”, we have analyzed your requirement from your query.
Your requirement to load the diagram automatically on the page without using
button click is achieved. We have provided simple sample to meet your
requirement. Please refer to the sample from the following link.
Please let us know if you have any
concerns.
Regards,
Saranya C
I don't see a link to the sample project on my end.
Chase
Hi Chase,
Sorry for the inconvenience caused.
Regarding “To load diagram on page
without using button click”, we have analyzed your requirement from your query.
Your requirement to load the diagram automatically on the page without using
button click is achieved. We have provided simple sample to meet your
requirement. Please refer to the attached sample.
Please let us know if you have any
concerns.
Regards,
Saranya C
Hi Chase,
Sorry about the inconvenience caused.
Regarding “To load diagram on page
without using button click”, we have analyzed your requirement from your query.
Your requirement to load the diagram automatically on the page without using
button click is achieved. We have provided simple sample to meet your
requirement. Please refer to the sample from the following link.
Link: http://www.syncfusion.com/downloads/support/directtrac/general/117109587561415.zip
Please let us know if you have any
concerns.
Regards,
Saranya C
I've downloaded and run the sample project, and it's not working for me. I'm getting an 'Object reference not set to an instance of an object' error on the DiagramControl.Load(s.Stream) call, just as happens in the test project I linked previously. Do you have any idea why this project would work for you guys and not on my machine?
Chase
We've done some more testing with the sample project. As is, with the Load() call after InitializeComponent() it errors out with a null reference exception. If we put the Load() call inside of the user control's Loaded event call, it doesn't error out but the diagram file doesn't load inside the control (the control is blank). If we put the Load() call inside of a button click event call, it works as expected. Any idea why we're seeing this varying behavior from the Load() function?
Thanks,
Chase
We are working on your requirement, we will update you on Monday September 22nd, 2014.
Please let us know if you have any concerns.
Regards,
Saranya C
Hi Chase,
We deeply regret for the inconvenience caused.
We are unable to reproduce the reported issue with DiagramControl.Load with Diagram Silverlight. The DiagramControl.Load is working fine in our side it would be better for us if you provide the sample /video/Stack trace to replicate the reported issue. This help us to serve you better.
Please let us know if you have any concerns,
Regards,
Ramya
- 24 Replies
- 5 Participants
-
CN Chase Novack
- Aug 13, 2014 08:07 PM UTC
- Sep 23, 2014 04:02 PM UTC