How to Prevent Automatic Vertical Scrolling in UWP TreeView - windows

Whenever an item is selected in my TreeView, it automatically does a vertical scroll and positions in the middle. How to prevent this automatic scrolling in UWP TreeView?
I found this StackOverflow answer on preventing horizontal scrolling in WFP but I can't find any
<EventSetter Event="RequestBringIntoView" Handler="TreeViewItem_RequestBringIntoView"/>
event in UWP.

Related

Xamarin Forms Scrollview and using Drag and Drop Gesture Recognizer

I have a scrollview that has a bindable stacklayout inside it with a Item template that is using the drag and drop gesture recognizer. This works no problem but on android the drag gesture recognizer fires off immediately as soon as you start scrolling the screen. I'm curious if anyone has any ideas on how to handle keeping the gesture recognizer but also allow for the user to scroll the screen without dragging around an item in the list.

Horizontal Scrollbar Controls Instead Of Bullet Controls For Glidejs

Does Glide allow for a horizontal scroll bar as the control UI for sliding through images? Right now I only see button controls, where each button maps to a slide.
Just to be clear I am still definitely interested in swiping behavior of course. I'd just like the button controls to behave like a scroll as well.
If Glide indeed allows for horizontal scrolling for controls can someone share how they implemented this? I cannot seem to find any guidelines in the docs.

Disabling swipe in my webviews for my panorama to get it

I'm beggining at coding on WP7.
For my first app on this platform, i don't have much to do, just creating a panorama which displays webviews in each of its items.
My problem is that I want the horizontal swipe gesture to be recieved by my panorama, and the rest of the touch event by my webviews.
Would anyone have an idea how to achieve this ?
So far I don't think anyone has found a way to host a WebBrowser within a Panorama or Pivot. See the following questions for example:
Map inside Panorama moves the panorama when panning map
WP7 Pivot control and a WebBrowser control
The best I have managed so far is to suppress pan and zoom for a WebBrowser control - but I haven;t found a way to re-route the touch interactions to the hosting Panorama / Pivot.

Windows Phone 7 WrapPanel within a ScrollViewer

I've got a page with the following XAML in my application.
<ScrollViewer VerticalScrollBarVisibility="Auto">
<toolkit:WrapPanel x:Name="WrapPanelImages" />
</ScrollViewer>
In the page constructor I load a set of images into the WrapPanel. These images are being displayed correctly but scrolling isn't working very well. I'm testing this on the emulator. The problem is that if I drag and scroll downwards as soon as I let the mouse go the ScrollViewer is scrolling back to the top. So it is impossible to get to the bottom of the WrapPanel. If I add the HorizontalScrollBarVisibility property to the ScrollViewer and set it to Auto I get a long line of images that flows off the screen horizontally, but the scrolling works in that case i.e. if I scroll to the right and let go of the mouse it doesn't scroll back to the left automatically.
How can I fix this scroll-to-the-top behavior? Or is this a bug in the emulator? My AppHub registration has not been approved yet so I can't sideload the app on my phone to test it.
At a glance this sounds like the same problem you get when wrapping a TextBlock in a ScrollViewer and you haven't constrained the ScrollViewer's size to the device height.
Check your ScrollViewer isn't some very large height such that the content is fitting entirely in it without needing to scroll.
If that is the case the action of it bouncing back is normal for trying to scroll past the beginning or end of the content.

How does the Outlook app delete checkbox UI xaml code work?

If you tap on the left hand side of the screen in Outlook then an event is triggered (in this case a checkbox appears).
I would like to know the xaml on how this is achieved. It cannot be a simple "MouseLeftButtonUp" event because if you drag your finger more than a few pixels then the event does not trigger.
In my own app I am trying to get an icon appear within a listbox that has a SelectionChanged event. The issue is that if you do not touch the small icon precisely then you are triggering the listbox event rather than the event I want to occur when pressing the image.
I think I need to wrap my image in a Canvas but then am still stuck as to what the event should be.
How do you increase the target size of the area where a user can click on your element?
What event should an image have when within a listbox (which is within a pivot) that has a SelectionChanged event? (MouseLeftButtonUp causes issues if you half drag to the next pivot and lift your finger - it triggers the MouseLeftButtonUp event)
I implemented something very similar to that behavior by making an itemtemplate where the checkbox was pushed offscreen to the left by using a negative margin.
I then created 2 visual states, one for Open and Closed. The open state set the margin to 0, bringing the checkbox back onscreen. Closed state had the negative margin.
With the fluidmove behavior, switching between states on button press was EASY. The only thing you'd have to add would be an invisible button/touch area on the left that would also trigger "opening" the checkbox column (changing state to reset the margins).
Hope that helps...
The outlook app is a native app, so it probably isn't using xaml at all.
If you're worried about the mouse events, then you should look at the gesture stuff in the silverlight toolkit, it contains tap, etc events that make a little more sense on the phone.
Increasing the target size and generally making stuff touchable: wrap it in a Button, then alter the ControlTemplate for the Button to remove the border.
If you look at the ControlTemplate for a Button, (Expression Blend, Edit Template, Edit a copy) you'll see the mechanics of the touch area. It's nothing more than padding/margin.
Thus, you can't bleed your touch region out without altering the layout and affecting other items around the control. I'd do two things:
First, I'd think about whether my whole control should be larger in the first place with good spacing around it. Is my design right?
Second, I'd cheat. I'd float a fixed sized button with no border over the area using the Translate transformation to move it around freely.
Good luck,
Luke

Resources