I am making an app based on Panorama control. Here my XAML below:
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
...
<phone:Panorama x:Name="MyPanorama">
<phone:PanoramaItem x:Name="FirstItem">
...
</phone:PanoramaItem>
<phone:PanoramaItem x:Name="SecondItem">
...
</phone:PanoramaItem>
</phone:Panorama>
I want to disable scrolling between FirstItem and SecondItem, and later to enable this feature. It does not matter how to do it (by xaml or code behind), but Panorama control is required to use. How to achieve this?
I'm probably late on respond to this, but the solution should be the property IsHitTestVisible.
Using this property on the panorama control, you can disable your control whenever you want to.
//Disable panorama scrolling
MyPanorama.IsHitTestVisible = false;
//Enable panorama scrolling
MyPanorama.IsHitTestVisible = true;
Related
I am using Forge viewer on mobile device.
Default Forge viewer is rolling on mobile device when moving to a position using pinch gesture.I research how to fix the roll (reference to Fixing pinch-zoom in Forge viewer applications - Through the Interface, GitHub - wallabyway/forge-pinch-zoom: customized iPad/IPhone/Android pinch zoom touch controls for ForgeViewer), but it is missing default 3D control. For example, it's missing pan motion when I use two-finger gesture. I want to fix the roll without missing the default 3d control. How do I do it?
I have tried to disable to rotate gesture in GestureHandler. (gestureHandler.setGestureParameter(); )
I have checked to invalidate pinch gesture correctly; gestureHandler.setGestureParameter('pinch', 'enable', false)
But I have checked that it is still valid to roll, regardless if the enable is false; gestureHandler.setGestureParameter('rotate', 'enable', false).
let orbit = viewer.impl.controls.getActiveTool()
let gestureHandler = orbit.controller.getActiveTools()[2]
gestureHandler.setGestureParameter('rotate', 'enable', false)
I have another question.
It emits the pinch event after I pinch gesture. I understand this behavior.
It is not emitting the roll event after I do the roll gesture while doing the pinching gesture. I can't understand this behavior.
Maybe there are the multiple methods controlling the camera roll. I can't figure out the method to control the roll on mobile device anywhere.
We are using a custom extension to handle window selection in the forge viewer following the steps from this blog post: https://forge.autodesk.com/blog/custom-window-selection-forge-viewer-part-iii.
We're able to set 'partial selection' mode on that extension. Is there a way to do this with the new BoxSelection extension that was added in v7.32?
A new option is added with Autodesk.BoxSelection extension:
useGeometricIntersection
Due to the other issue, this option is not on by default, you can switch it by the code below. After it is loaded again, Left to right mouse drag is containment, Right to left mouse drag is intersection.
async function enableGeomtricBoxSelection() {
// unload the extension, which was loaded with geometric selection turned off
viewer.unloadExtension('Autodesk.BoxSelection');
// reload the extension with geometric selection turned on
ext = await viewer.loadExtension('Autodesk.BoxSelection', {
useGeometricIntersection: true
});
// Display the toolbar button (optional) in the toolbar. You can invoke box
// selection by holding cmd(mac) / ctrl(windows) + mouse drag
ext.addToolbarButton(true);
}
enableGeomtricBoxSelection();
Same issue as Adding MapControl in xaml results in a "Catastropic failure" , the bing map control cannot be collapsed without causing a catastrophic exception. Worse, just put a map inside a collapsed container and it will crash too. It means that every parent, grandparent, and so on MUST be collapsed using code behind. breaking mvvm pattern for no reason just to display and hide a map.
Is there someone who found a workaround ? It's crazy that MS didn't fix their own control for such a long time even when they know it doesn't behave as intended..
Any help is appreciated !
This is the first time I've heard of this issue. It's worth noting that the map control in WP8.1 wasn't created by Microsoft, but Nokia. In Windows 10 Microsoft took the Nokia control and combined with the features of the Windows 8 map control and made it much more stable.
Update:
I've taken a look at this issue. It's not easy to figure out what is causing the error as the map control is written in native C++ and the error that is thrown has inaccessible properties that show up as "?". That said, I did manage to figure out a workaround. Collapsing a control is not much different than giving a control a width and height of 0. With this in mind here is a code sample of how to show/hide the map using width/height instead of visibility.
<Page
x:Class="WP81App.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:WP81App"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
xmlns:Maps="using:Windows.UI.Xaml.Controls.Maps"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid>
<Maps:MapControl Name="MyMap" Height="0" Width="0" />
<Button Content="Show Map" Click="ShowMapBtn_Clicked" HorizontalAlignment="Center"/>
</Grid>
</Page>
Button handler:
private void ShowMapBtn_Clicked(object sender, RoutedEventArgs e)
{
var mapContainer = MyMap.Parent as FrameworkElement;
MyMap.Width = mapContainer.ActualWidth;
MyMap.Height = mapContainer.ActualHeight;
//Hide the button
(sender as Button).Visibility = Visibility.Collapsed;
}
I am using kinetic-v4.3.0-beta2.js
I want to handle mobile touch event on group for ios & android.
I am binding event such as following
group.on('touchstart', function (evt) {
$('#onpopMenu').popup("open", { x: leftPosition, y: topPosition });
});
I tried 'touchend', 'touchstart' and 'tap'
Got partial success in "Tap" but in that case, shape is draggable so tap event is not properly fire because object will move from it's place.
but if shape is not draggable then it will work fine.
I tried 'touchend' and 'touchstart' event also but popup menu is close after event fire in iOs and android as I am opening Jquery Mobile Popup by Touching group!
The popup menu will only open for 2-3 seconds when the touchstart event fired.
Anyone faced the same problem with kinetic JS Mobile events? How to handle only "Click" or "Touch" event with it.
I checked this http://www.html5canvastutorials.com/kineticjs/html5-canvas-mobile-events/ for reference but had no luck!
I am developing application with Phonegap + JQM + Kinetics JS
Thanks in advance!
Keep in mind that your application is running inside a webview. This is why you've got these 2/3 seconds of delay on touch/click event.
This is why in all my PhoneGap dev, I use Fastclick.js. FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a click event on mobile browsers. The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.
You can find it here https://github.com/ftlabs/fastclick.
It's easy to use (if you're using jQuery) :
<script type='application/javascript' src='/path/to/fastclick.js'></script>
<script>
$(function() {
FastClick.attach(document.body);
});
</script>
I made a jsfiddle for you to test out the click/touch events.
From what I understand, you have a Kinetic.Group node that is draggable but you want to open up a popup using jquery mobile.
You are right that when you drag an object, the tap event does not fire. But you said otherwise the tap event works fine if the shape is not draggable. This leads me to believe:
You want a popup on "tap"
You want a popup on "dragend"
If so, all you need is to use both events like this:
group.on('tap dragend', function (evt) {
$('#onpopMenu').popup("open", { x: leftPosition, y: topPosition });
});
Please let me know if my assumptions are wrong, and I can work with you to get the right solution. I am guessing when you want to popup, so if you let me know exactly when you want a popup to occur that will help a lot.
You might want to also look into using evt.cancelBubble = true; http://www.html5canvastutorials.com/kineticjs/html5-canvas-cancel-event-bubble-propagation-with-kineticjs/
I want to create a dialog or alert box, where a DisplayObject would take and force the focus, until an okay button or something releases the lock. thanks.
The easy way to do this is to make your "dialog" as big as the stage, with a whacking great transparent area around the dialog itself.
The transparent area can listen for any mouse clicks, and just swallow them (which will prevent them being picked up by stuff further back in the display list).
To show the alert, just stick it on top of everything else, When the user closes it, take it away again.
If you are using flex and actionscript, simply use a SkinnablePopUpContainer
var alt:CustomPopUp = new CustomPopUp();
alt.open(this,true) //the second variable is for modal, which will disable view
this.enabled = false; //this will grey out the parent view and provide visual focus to your popup.
To do this, you will need to disable access to all objects under your 'alert' DisplayObject. There are multiple ways of doing this, here 2 I can think off:
Loop through the display list and disable any display objects under your alert depth wise.
Cheat it with a blocker. When you display your alert, display another clip (could have alpha set to 0 ) that blocks the user from hovering/clicking objects. The blocker might need a bit of setup( buttonMode = true, useHandCursor = false, etc. )
This 'modal' behavior has been around for some so there might be no need to reinvent the wheel, depending of your current setup.
If you're using the Flex framework, you've got the functionality in, for Flash you can use the Alert Manager from the Yahoo! Flash Astra Components:
Goodluck,