Window 8 Frame navigation events - windows-8

I need to hook into the frame navigation events. How and when should I hook into the frame navigation events?
I tried In the constructor of a page but it seems the frame has not been created yet.
Thanks

If you placed the Frame in a page, then try hooking it in Page.OnNavgatedTo event and unhook it in Page.OnNavigatedFrom.

Related

Prevent screen blur in React Native Navigation

React Navigation library supply me the blur event, that trigs when the focused screen is going to be unfocused. Great.
But what if I need to prevent the blur action itself by stopping the user to go away from this screen? The docs only mentions the 'beforeRemove' event, that is something else.
Is there a way to prevent a user to go away from a screen using the screen component logic?
Basically, blur event's callback function must navigate to this page

React Native - Keyboard is automatically hiding

I've got a problem with keyboard in react native. I have a component with TextInput inside of it. The problem is when I am touching it - keyboard is starting to show, but immediately hiding back. (Checked with event listeners of Keyboard - event keyboardWilHide triggers, but I don't know what triggered it).
My assumption that the core of the problem in my navigation architecture. I have materialBottomTabNavigator which has materialTopTabNavigator inside, which has StackNavigator inside, and my component is a screen in stack navigator. Probably some tabs properties are triggering Keyboard Hide event, but I did not found any.
(In terms of debug launched app with my component moved out of this type of navigation and everything works fine).
Would appreciate any help. Thanks in advance!

React Native: ScrollView with auto scroll

I would like to create a carousel that scrolls automatically until the user scrolls / touches the ScrollView itself.
The auto-scrolling itself works fine with using scrollView.scrollTo but how could I detect if the user is interacting with the ScrollView? I took a look at the onScroll event but this does not seem to distinct between a user generated event and an event that was generated by calling scrollTo.
Also I'd like to know if it is possible to get the current scroll position from the ScrollView directly instead of reading it everytime from the onScroll event.
I'm very thankful for any tips and suggestions.
By digging into ScrollView's source code you can notice a few undocumented callbacks that will help you achieve what you're after, namely onTouchStart and onTouchEnd. These two callbacks are triggered only when user interacts with the ScrollView and not when you scroll programmatically.
You will probably want to clear your auto-scroll interval on onTouchStart and restart it after a delay on onTouchEnd.
Regarding your next question, the answer is no. As far as I know, no getter is currently exposed to retrieve the current scroll position. Therefore, you need to rely on the event passed to onScroll, retrieve event.nativeEvent.contentOffset['x' or 'y'], and store it in your component's state.
Note that if you're doing some heavy animations that need to follow scroll position closely (e.g. animated header or parallax image), it would be a good idea to use the native driver for Animated.event. You can learn more about it on React Native's blog.

Proxy PanResponder / gestures to another component

I have a component that response to gestures and another component smaller in size that's overlaying it (position: 'absolute').
Is there a way for the overlaying component to proxy gestures to the component under it or to a specific component?
Answering my own question: what you need is the 'pointerEvents' View property.
In my case, I had to set it to 'box-none' which means the View ignores gestures and forwards it on, but elements inside the view (like buttons) do get the events if clicked on.
https://facebook.github.io/react-native/docs/view.html#pointerevents

What event is rised when changing between two BorderContainers using TabBar component?

I am developing Adobe Air desktop application using Apache Flex 4.9.1 SDK.
I am using a TabBar control in order to go through different windows. For a window I am using a BorderContainer control.
My question is:
Is there any event raised(in the BorderContainer control not in the TabBAr control) when you change from one window to another using the tabs. The event in TabBar is "change", but I need to capture this moment in the BorderContainer. I have tried "FocusOut", "Hide", "Deactive" events, but they are not raised. So does anybody knows what is happening in the BorderContainer when the tab is changed?
Thank you in advance!
Use the change event on the tab bar ..