Skip to main content
Mar 3, 2021 2:24 AM UTC
Solved

Navigate view after all steps finished playing

Hi,

 

I have multiple views in a project. 

How to automatically navigate to second view after steps in first view end. I'm using Hololens 2
 
Thank you. 
sebbenAnswer
Mar 5, 2021 6:20 AM UTC

That should not be possible unless you also kept the first solution. ( But it should wait until the step is completed anyway)

 

To rewind a step just add a button and connect the click event with the rewind service of the model.

 

If you want to make sure the last step is finished before the user can change the view you can change condition of the if statement:

if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps && $scope.view.wdg["model-1"].playing == false)

 

If it still does not work can you please share an example how you are trying to do it. Thanks.

 

7 replies

Mar 3, 2021 7:23 AM UTC

Hi,

you can use this function:

 

$scope.$on('stepcompleted', function(evt, arg1, arg2, arg3) { 
if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps){
 $scope.navigate("View2");
	}
}); 

 

Make sure you change the model and view name according to your experience.

KM_01Author
Mar 4, 2021 8:03 AM UTC

Hi, thank you for your response.

 

i've tried it, and it works. 

 

But i've concern regarding swipe left gesture. Is it possible to navigate view if the last step has finished playing without user clicking on rewind button and then user swipe left?  

Mar 4, 2021 8:26 AM UTC

You can use the swipe left gesture. You need to write a function like this:

$scope.navigateToView = function() { 
if($scope.view.wdg["model-1"].currentStep == $scope.view.wdg["model-1"].steps){
 $scope.navigate("View2");
	}
}

 

Next, click the JS icon next to the swipeleft application event, and enter the following in the expression box: viewCtrl.navigateToView();