Adding a new property while serializing the SfDiagram is not supported.
Hello,
I am saving SfDiagram as below. When I reload after saving, it loads without any problems. But if I add a new variable to my inside classes, I get an error that that variable doesn't exist. If a new variable is added in the future, will I not be able to load old saved xaml files in my class?
if (dialog.ShowDialog() == true)
{
using (Stream strC = File.Open(dialog.FileName, FileMode.CreateNew))
{
Diagram.Save(strC);
}
}
Error :
The 'Element' '_description' is not expected from the Controls.Properties' namespace. Expected element: '_test'.'
If I use the following command, I get an error like this.
Diagram.Upgrade(myStream);
Error : System.NotSupportedException: 'Stream does not support writing.'
I added an example. There is trial.xaml in the debug file. This file is a version saved before adding the "Deneme" variable in the TextControlProperties class in the Project. If you delete the "Deneme" variable from the project, the installation will be fine. But when a new variable is added in the class, you will get a loading error.
Attachment: WpfApp9_c4198c79.rar
If I add [OptionalField] attributes to the variable I can load it without a problem. Do I have to give this attribute to all variables? Is there an alternative solution?
Hi Ozgur,
Currently, we are trying to find other alternative solution for your request. We will update you with more details on May 30, 2023.
Regards,
Karkuvel Rajan S
Hi Ozgur,
Currently, we don’t have any direct solution for your requirement. Please use the same procedure of adding [OptionalField] attributes to the newly added properties to overcome the issue. In future, if we find any solution, we will share it with you.
Regards,
Karkuvel Rajan S
Thank you for the response.
Hi Ozgur,
You're welcome. We are glad to know that the reported problem has been resolved at your end. Please let us know if you have any further queries on this. We are happy to help.
Regards,
Preethi R
- 6 Replies
- 3 Participants
-
ÖZ Özgür
- May 25, 2023 12:21 PM UTC
- Jun 2, 2023 10:03 AM UTC