RadDiagram Layout with Busy indicator

8 posts, 0 answers
  1. Brett
    Brett avatar
    14 posts
    Member since:
    Feb 2014

    Posted 03 Mar 2014 Link to this post

    I am creating some rather large diagrams that take some time to load, so I am using a busy indicator to display while the diagram loads. I run this busy indicator in a background thread to keep the UI responsive. Once the loading is complete in the RunWorkerCompleted method I set the GraphSource property in my ViewModel which is bound to my diagram. I am subscribing to the GraphSourceChanged event of the diagram, at which point I set the layout to be ​'TreeLayoutType.TreeDown'. 

    This was working perfectly until I introduced the busy indicator on a seperate thread. The GraphSourceChanged still gets called at the appropriate time however the diagram does not layout at all with all of the diagram items stacked on top of each other. Im assuming this is a threading issue, but thought it would work correctly as in setting the databound GraphSource property on the RunWorkerCompleted which should be using the UI thread.

    Any help appreciated.
  2. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 06 Mar 2014 Link to this post

    Hello Brett,

    Could you please try using LayoutAsync() method instead of Layout() and let us know if it solves this scenario ? Thank you in advance.

    Regards,
    Petar Mladenov
    Telerik

    DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

  3. UI for WPF is Visual Studio 2017 Ready
  4. Brett
    Brett avatar
    14 posts
    Member since:
    Feb 2014

    Posted 06 Mar 2014 in reply to Petar Mladenov Link to this post

    The LayoutAsync() has resolved the issue thank you!!

    However, as suggested in the support ticket to get the AutoFitAsync() to work I downloaded the latest 2014 Q1 release and I get the following runtime exception.

    Set property 'System.Windows.ResourceDictionary.DeferrableContent' threw an exception.n.

    I notice that other users have experienced the same exception with other releases. I have given up on this for now as i have wasted all morning on it and reverted to the previous version.
  5. Petar Mladenov
    Admin
    Petar Mladenov avatar
    2891 posts

    Posted 07 Mar 2014 Link to this post

    Hi Brett,

    We can assist you in upgrading your project to Q1 2014. Could you please elaborate a bit more on your XAML exception ? Have you checked if there is an inner exception ? When upgrading to new assemblies you also need to update your styles sometimes. If you have used a custom styles that are modifications of Styles from previous releases you may need to update some of them to the Styles release with Q1 2014.

    You can send us the styles that produce the exception and will help you in upgrading them.

    Regards,
    Petar Mladenov
    Telerik

    DevCraft Q1'14 is here! Join the free online conference to see how this release solves your top-5 .NET challenges. Reserve your seat now!

  6. Brett
    Brett avatar
    14 posts
    Member since:
    Feb 2014

    Posted 11 Mar 2014 in reply to Petar Mladenov Link to this post

    That is the inner exception. The first exception is 'Initialization of 'Telerik.Windows.Controls.Diagrams.Extensions.RadGeometryButton' threw an exception.' 

    BaseUrl - /Telerik.Windows.Controls.Diagrams.Extensions;component/Themes/GenericVista.xaml

    However I am not using this GenericVista.xaml style and  have not referenced it in previous versions.

    Furthermore, the AutoFitAsync() is still not an available method to call on my diagram.
  7. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 14 Mar 2014 Link to this post

    Hello Brett,

    It looks like our latest official release is not referenced in your custom application. I think so because the AutoFitAsync() method is available in our Q1 2014 release. Could you please double check if the proper binaries are referenced in your application?

    Regarding the reported exception, it could also be caused by different versions of the referenced binaries.

    Please make sure that all binaries are from our Q1 2014 official release and let us know if you still reproduce the issue.

    Regards,
    Pavel R. Pavlov
    Telerik
     

    DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

     
  8. Brett
    Brett avatar
    14 posts
    Member since:
    Feb 2014

    Posted 21 Apr 2014 in reply to Pavel R. Pavlov Link to this post

    I have checked the assemblies and they are all from the latest release. I can now the new AutoFitAsync() method, however I am still getting the exception.

    Inner Exception: ​The method or operation is not implemented.

    Stacktrace:

       at System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType, Int16 typeId)
       at System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId)
       at System.Windows.Baml2006.Baml2006Reader.Process_PropertyTypeReference()
       at System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
       at System.Windows.Baml2006.Baml2006Reader.ReadKeys()
       at System.Windows.ResourceDictionary.SetDeferrableContent(DeferrableContent deferrableContent)
       at System.Windows.Baml2006.WpfSharedBamlSchemaContext.<Create_BamlProperty_ResourceDictionary_DeferrableContent>b__168(Object target, Object value)
       at System.Windows.Baml2006.WpfKnownMemberInvoker.SetValue(Object instance, Object value)
       at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(XamlMember member, Object obj, Object value)
       at MS.Internal.Xaml.Runtime.ClrObjectRuntime.SetValue(Object inst, XamlMember property, Object value)


    I can see this value in the baseUrl, not sure why its trying to access GenericVista.xaml?

    {pack://application:,,,/Telerik.Windows.Controls.Diagrams.Extensions;component/Themes/GenericVista.xaml}







  9. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1182 posts

    Posted 24 Apr 2014 Link to this post

    Hi Brett,

    As I am not able to reproduce the reported exception on our side I will ask you to create a small isolated project demonstrating the issue and send it over. You can do this by using our ticketing system. You can log into your Telerik account and you will be able to start a new ticket where you can attach a zip file.

    By sending us a small repro project we will be able to reproduce the reported behavior on our side and further investigate the reasons behind.

    Thank you for your kind cooperation.

    Regards,
    Pavel R. Pavlov
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top
UI for WPF is Visual Studio 2017 Ready