Hello again,
i am trying to build a year changer inside my app. The concept is to have a small rectangle
with the year inside and when pressed animate changing it’s width and height so you can change the year. Also i want the user to be able to close/deactivate it when clicking anywhere else on the screen. My problem is that when i click
anywhere else it triggers both panel’s and rectangles Handler
. Here is the code :
<Page ux:Class="Year">
<JavaScript File = "year.js"/>
<DockPanel Width="100%" Height="100%" HitTestMode="LocalBoundsAndChildren">
<Panel Height="5%" Dock="Top" Margin="0,40,0,0">
<Text Value="Choose Starting Year" FontSize="20" Color="White" TextAlignment="Center" />
</Panel>
<Panel Width="100%" Height="95%" Dock="Bottom">
<Panel ux:Name="self" Visibility="Visible" Width="40%" Height="50" Color="#9F9F9F" Opacity="0.5">
<Text Value="{year}" Alignment="Center" FontSize="25" Color="Black"/>
<WhileTrue Value="{yearInput}">
<SwipeGesture Direction="Up" ux:Name="SwipeUp" Length="20"/>
<Swiped Source="SwipeUp">
<Callback Handler="{moveUp}"/>
</Swiped>
<SwipeGesture Direction="Down" ux:Name="SwipeDown" Length="20"/>
<Swiped Source="SwipeDown">
<Callback Handler="{moveDown}"/>
</Swiped>
<Change self.Color="#fed166" Duration="0.25"/>
<Change self.Opacity="1" Duration="0.25"/>
</WhileTrue>
<Clicked Handler="{enableYearFiltering}">
<Set self.Width="70%"/>
<Set self.Height="25%"/>
<Set self.Color="#fed166"/>
<Set self.Opacity="1"/>
</Clicked>
<LayoutAnimation>
<Resize X="1" Y="1" RelativeTo="LayoutChange" Duration="0.25"/>
<Move X="1" Y="1" RelativeTo="LayoutChange" Duration="0.25"/>
</LayoutAnimation>
</Panel>
</Panel>
<Clicked Handler="{disableYearFiltering}">
<!-- <Set self.Width="40%"/>
<Set self.Height="50"/> -->
</Clicked>
</DockPanel>
</Page>
Also, i found on one of the examples the SwipeGestures
Up and Down and i used them so i can increase and decrees the year number but that way it changes one number at a swipe… Is there a tutorial or a way to do it and have a continuous change of the numbers ?
Thanks in advance