Skip to content

Conversation

@PureWeen
Copy link
Contributor

@PureWeen PureWeen commented May 6, 2015

As it stands now I can't get IsUnpausing to fire which I'm pretty sure is caused by the fact that the Fast Resume features of Win 8.1 means App.OnLaunched is never called because "resuming" in WinRT isn't really the same as :"Launching" .. As I understand it a Suspended WinRT application stays in memory (with limited functionality) unless it's actually terminated and will usually just stay in memory for awhile unless memory pressures dictate otherwise... The info on it (https://msdn.microsoft.com/en-us/library/windows/apps/hh464925.aspx) says it might just sit there in memory suspended for days

Hopefully that makes sense... The language in RxUI doesn't correlate to WinRT's names for things (not saying it should) but that might make what I'm saying confusing :-x

Here's my stab at the modification that seems to work when I tested it in the PlayGround projects

            var fastResuming = new Subject<ApplicationExecutionState>();
            app.Resuming += (o, e) => fastResuming.OnNext(ApplicationExecutionState.Suspended);
            var unpausing = new[] { ApplicationExecutionState.Suspended, ApplicationExecutionState.Running, };
            RxApp.SuspensionHost.IsUnpausing = _launched
                .Select(x=> x.PreviousExecutionState)
                .Merge(fastResuming)
                .Where(x => unpausing.Contains(x))
                .Select(_ => Unit.Default);

Suspended in WinRT still means you're entering a limited state of functionality (for example you can't get GPS location) so it's not like it's just same behavior but not visible it's still "suspended" so it's a good thing to be able to wire into.... Which is why I ran into this :-) Because I need to suspend some GPS/network stuff going on if the user "suspends" the app and then start those things back up with the app enters the foreground

…g for the IsUnPausing behavior on AutoSuspendHelper because of how Fast Resume works
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you fix the tabs? It looks like your editor is set for hard tabs. Just make another commit to fix it, no need to close and reopen the PR

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Latest commit should have hard tabs removed...

@ghuntley ghuntley added this to the ReactiveUI 7.0 milestone Dec 21, 2015
@ghuntley ghuntley modified the milestones: 7.0.0, ReactiveUI vNext Nov 6, 2016
@ghuntley ghuntley closed this Nov 7, 2016
@ghuntley ghuntley changed the base branch from master to develop November 7, 2016 09:54
@ghuntley ghuntley reopened this Nov 7, 2016
@ghuntley
Copy link
Member

ghuntley commented May 16, 2017

@PureWeen closing this off due to age/branch no longer exists. Sorry about the poor turn-around. Raise another PR if this is something that still needs addressing.

@ghuntley ghuntley closed this May 16, 2017
@lock lock bot locked and limited conversation to collaborators Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants