Hi,
In my app I need to create a slider that make a specific action so when I swipe to the right it will execute some function. I create a custom Slider
but I don`t know how to animate the movement of the slider if I release it before I get to the right corner. Here is my code:
<App>
<Panel>
<RangeControl ux:Class="BotonDePanico" Focus.IsFocusable="true" HitTestMode="LocalBounds" Width="300" Height="70">
<string ux:Property="Text" />
<LinearRangeBehavior />
<JavaScript>
var Observable = require("FuseJS/Observable");
var sliderValue = Observable(0);
function SliderReleased() {
if(sliderValue.value < 95) {
sliderValue.value = 0;
}else {
//Do something
}
}
module.exports = {
SliderReleased: SliderReleased,
sliderValue: sliderValue
};
</JavaScript>
<Panel>
<DataBinding Target="this.Value" Key="sliderValue" />
<Panel ux:Name="thumb" Alignment="Left" Width="70" Height="70" HitTestMode="LocalBounds">
<Text Value="Hi!" Alignment="VerticalCenter" TextAlignment="Center" TextColor="White" />
<Circle Color="Black" />
</Panel>
<Text ux:Name="currentValue" Value="dasdasd" Alignment="VerticalCenter" Margin="80,0,0,0" />
<Panel Layer="Background">
<Rectangle CornerRadius="50" Height="70" Color="#E4E4E4" />
</Panel>
</Panel>
<Released>
<Callback Handler="{SliderReleased}" />
</Released>
<ProgressAnimation>
<Change currentValue.Opacity="0" />
<Move Target="thumb" X="230" />
</ProgressAnimation>
</RangeControl>
<BotonDePanico />
</Panel>
</App>