locked
View state corrupted after workflow loaded RRS feed

  • Question

  • Hello,

    These is the code that use to add saved XAML workflow in a RehostedDesigner Toolbox

     var category = new ToolboxCategory("Cat1");
                var item = new ToolboxItemWrapper(typeof (DynamicActivityTemplateFactory));
                category.Add(item);
                ToolboxControl.Categories.Add(category);

    public class DynamicActivityTemplateFactory : IActivityTemplateFactory { private string text = @"<Activity ... </Activity>"; public Activity Create(DependencyObject target) { string tempPath = Path.GetTempFileName() + Guid.NewGuid() + ".XAML"; var file = new FileInfo(tempPath); using (Stream stream = file.OpenWrite()) { using (StreamWriter writer = new StreamWriter(stream)) { writer.Write(text); } } XamlXmlReader xamlReader = new XamlXmlReader(file.FullName); ActivityBuilder ab = XamlServices.Load(ActivityXamlServices.CreateBuilderReader(xamlReader)) as ActivityBuilder; return ab.Implementation; } }

    the problem is that the view state is lost when I want to preview it in the designer!!

    Have any idea about these please 

    Thursday, March 7, 2013 1:26 PM

All replies

  • Hi,

    For your issue, I would suggest you debug your code and see when the viewstate is lost. That will help you find the main issue.

    Best wishes,


    Catherine
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Catherine Shan - MSFT Monday, March 18, 2013 1:56 AM
    • Unmarked as answer by g.said Monday, March 25, 2013 10:11 AM
    Thursday, March 14, 2013 8:27 AM