locked
Do I have to manage reference counts of ApplicationView like MultipleViews sample? RRS feed

  • Question

  • I dived into MultipleViews sample,then I found managing reference counts at ViewData.cs.

    It seems like quite complex...

    Do I have to manage like this?

    Dose ApplicationView.Consolidated event happens many times?

    Why it use lock instead of calling dispatcher.RunAsync? Calling dispatcher.RunAsync and accessing member value from lambda inside it guarantees just one thread access to member value without lock.

    Why it checks refCount before calling FinalizeRelease? StartViewInUse may be called after ApplicationView.Consolidated was called?

    For me it looks like unnecessarily complex...


    cyclops

    Saturday, December 28, 2013 6:44 PM

All replies

  • which sample are you using?

    are you doing windows 8 development or windows 8.1?


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#


    Saturday, December 28, 2013 7:09 PM
  • Sorry,I'm doing 8.1 sample.

    cyclops

    Sunday, December 29, 2013 2:02 AM
  • ahh the multi window sample. yes i agree looks horrible complicated. you can strip much of the code but there is some nice functionality in that refcount so i would first try to build an app your self with multi window support that does the bare minium to get it working. then try to understand the sample.

    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    Monday, December 30, 2013 9:55 AM
  • My code worked with striped code,but when refcount is needed?

    This question is equal to when VisibilityChanged event is called concurrently?

    I don't understand who can access CoreApplicationView and when VisibilityChanged is called.I'll investigate them...


    cyclops

    Friday, January 3, 2014 6:30 AM