Win 10 UWP Mapcontrol PointerMoved event missing - vb.net

Until some month ago this code was able to rise the PointerMoved event:
<maps:MapControl Name="myMap" Canvas.ZIndex="1"> </maps:MapControl>
<StackPanel x:Name="overlay" Grid.Column="1" Grid.ColumnSpan="3" Canvas.ZIndex="5" Background="Transparent" IsHitTestVisible="False" />
It seems that something changed since this post has been published.
Right now I can't get anymore the MyMap_PointerMoved or MyMap_PointerPressed with or without the empty stackpanel over the map.
Curiously MyMap_PointerMoved event fires only if I leave the zoom + and - signs visible.
Event fires only when mouse is over the those sings.
I've added a polygon mapelement on the map. Only the MyMap_MapElementPointerEnter/Exited events fires.
Any idea how to solve this issues and make the maps work again?
Tnx. Stefano

Found the problem. For some reason I can't evaluate the .png image I have used until now in causing the crash. Replaced with a new one solved the problem.

Related

The scrollviewer "locks" when scrolling vertically or horizontally

If I start the scrolling vertically or horizontically the scroller "locks", such that you can only scroll horizontically or vertically, untill you let go. If I however start of by scrolling diagonally, there is no problem, in thhese cases I can manouvre the scrollviewer how i want. How do I make sure that the scrollViewer doesn't "lock" if I start of scrolling vertically or horizontically. Here is my scrollViewer:
<StackPanel>
<TextBlock x:Name="MainPageTitle" Text="{Binding title}" Height="89"/>
<ScrollViewer Width="768" Height="380" HorizontalScrollBarVisibility="Hidden">
<Map/>
</ScrollViewer>
<TextBlock x:Name="LEgE" Text="HEJHEJEHEJEHJEHJ"/>
</StackPanel>
So just to clarify, how do I make sure that no matter how I start of the scroll, I'm always capable of scrolling in any direction. With in the grid of course. Any help would be appreciated.
This is a known Issue that the scrollviewer runs on "rails".
Which is also stated in the artikel in msdn forums http://social.msdn.microsoft.com/Forums/wpapps/en-US/8fdbe189-c037-4f55-89c5-6d6814dc58f2/scrollviewer-locks-when-you-only-scroll-horizontally-or-vertically?forum=wpdevelop
But one could look at how to handle manipulation events for windows phone
http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff426933(v=vs.105).aspx
For this you need to set ScrollViewer.ManipulationMode to Control and manage it yourself.
But as stated in the first link, to acheive smoothness is very hard.

Windows8 Scrolling like in weather app

I have layout as described below:
<ScrollViewer>
<StackPanel Orientation="Horizontal">
<!-- ... -->
<ScrollViewer>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel ScrollViewer.VerticalScrollBarVisibility="Visible" Orientation="Vertical" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ScrollViewer>
<!-- ... -->
</StackPanel>
</ScrollViewer>
And I would like to achieve that effect that is present in weather app.
In my application, when you're scrolling horizontaly using mouse wheel, when pointer gets over ItemsControl it immediately starts scrolling verticaly wheras in weather application there's fluent horizontal scrolling effect and scrolling verticaly begins when there's some time hover that vertical collection.
Is that behaviour somewhere implemented by default?.
Szymon
Generally, the guideline is that introducing vertical scrolling in a horizontally scrolling repeater is a bad idea. I think you should NOT consider Weather (or any standard Windows 8 app) as a model to emulate. Most of them violate the guidelines in some of the worst ways.
The Weather app accomplishes what you are asking based on the current mouse placement, the motion of the grid, and control with focus. That's a complex way of saying, some developer dreamed up a solution to help make their UI as confusing to the user as possible.
Please, don't.
What I think they do in order to achieve that effect is this:
If the mouse is over the vertical list for a while, they deactivate the horizontal scroll and activate the vertical one. Once the mouse moved outside the list, they switch back (deactivate the vertical scroll and activate the horizontal scroll).
I have not tested this to see if this works, but I think it should.

Scrollviewer doesn't scroll with touch

So I have come to that point where I am saying to myself over and over again I am missing some basic stuff.
I have a ScrollViewer with a RichTextBlock that converts HTML to the content.
Everything shows up as expected but I can't scroll! I had the VerticalScrollBarVisibility to Hidden but I have taken that out. After seeing this anwsear in StackOverflow I have stoped with the following code:
<ScrollViewer VerticalAlignment="Stretch"
HorizontalScrollMode="Disabled"
VerticalScrollBarVisibility="Visible"
VerticalScrollMode="Auto"
ZoomMode="Disabled"
Padding="52"
Background="#60000000" >
<RichTextBlock rtbx:Properties.Html="{Binding TextHTML}"
TextAlignment="Justify"
FontSize="20" />
</ScrollViewer>
It also seems that the PanningMode is not avaiable in Windows 8 but I belive that it is still the expected behaviour to scroll with the touch.
I have tried to put the ManipulationMode to All in the ScrollViewer and also tried to set to none in the RichTextBlock. However, I got no sucess with those approaches.
Removing the manipulation modes and isolating the problem and simplifing the "options" I was using led me to the conclusion that the ScrollViewer wasn't the issue.
The problem was: I had was a Control that was on top of the ScrollViewer that was hidden (opacity = 0). This Control swallowed all the events that I was needing in the ScrollViewer. Basic mistake.
I had to put the Visibility equals to Collapsed.

Spinning CarouselPanel in ComboBox via Mouse

I am currently re-templating the ComboBox in a Metro XAML application.
The ItemsPanel is the standard CarouselPanel, which acts like a tumbler, endlessly revolving through the items list - nice !
An added nice detail, is that in the VS/Blend simulator if you 'flick' the items with the touch pointer then the carousel 'spins', rather like the Date tumbler in Windows Phone.
My problem is, when used in Desktop mode (via a mouse) I cant re-created the same spinning effect. there seems to be some kind of failure in the maouse/touch guesture translation.
Doesn anyone have any ideas about how to get this to work ?
At first I thought it might be like the GridView which does not bubble up the mouse wheel events. But then I tried the code below and the mouse wheel does spin it. It doesn't do this in Blend, but it does it at runtime fine.
<Grid Background="Black">
<ComboBox VerticalAlignment="Top">
<x:String>0</x:String>
<x:String>1</x:String>
<x:String>2</x:String>
<x:String>3</x:String>
<x:String>4</x:String>
<x:String>5</x:String>
<x:String>6</x:String>
<x:String>7</x:String>
<x:String>8</x:String>
<x:String>9</x:String>
<x:String>10</x:String>
<x:String>11</x:String>
<x:String>12</x:String>
<x:String>13</x:String>
<x:String>14</x:String>
<x:String>15</x:String>
<x:String>16</x:String>
<x:String>17</x:String>
<x:String>18</x:String>
<x:String>19</x:String>
<x:String>20</x:String>
<x:String>21</x:String>
<x:String>22</x:String>
<x:String>23</x:String>
<x:String>24</x:String>
<x:String>25</x:String>
<x:String>26</x:String>
<x:String>27</x:String>
<x:String>28</x:String>
<x:String>29</x:String>
</ComboBox>
</Grid>
Best of luck!

Slider overflow

I have popup-like border in my page. There is slider inside the popup. The slider has range from 0 to 100, but when I slide it to the right edge I get somewhere near to vlaue 93. Slider is full but its maximum is 100. It seems that slider overflowed the parent container. I tried to use all combinations of margins and static widths, but without success. Can anyone tell me what I am supposed to set, to get it work?
Here is fragment of code:
<Grid x:Name="LayoutRoot" >
...
<Border VerticalAlignment="Center" Margin="24,0" Visibility="{Binding ...}">
<StackPanel>
<TextBlock Text="choose desired position" />
<Slider x:Name="sldGoto" Maximum="100" SmallChange="1" LargeChange="10" Value="93"/>
</StackPanel>
</Border>
</Grid>
With this code (value of slider set to 93) is slider full. What's wrong?
This is a known bug in the current release when using Slider on Windows Phone 7 with the standard control template. I recommend using the approach you found on Dave's blog for now.
Well I just find article with nice Slider ControlTemplate that just works.
I would still appreciate if anyone could confirm this behavior or told me what I did wrong.
Thanks