File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
src/Xamarin.Forms.InputKit/Platforms/UWP Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ using Plugin . InputKit . Platforms . UWP ;
2+ using Plugin . InputKit . Shared . Layouts ;
3+ using Windows . UI . Xaml . Controls ;
4+ using Xamarin . Forms ;
5+ using Xamarin . Forms . Platform . UWP ;
6+
7+ [ assembly: ExportRenderer ( typeof ( StatefulStackLayout ) , typeof ( StatefulStackLayoutRenderer ) ) ]
8+ namespace Plugin . InputKit . Platforms . UWP
9+ {
10+ public class StatefulStackLayoutRenderer : VisualElementRenderer < StackLayout , StackPanel >
11+ {
12+ protected override void OnElementChanged ( ElementChangedEventArgs < StackLayout > e )
13+ {
14+ base . OnElementChanged ( e ) ;
15+ if ( Control != null )
16+ {
17+ Control . PointerPressed += Control_PointerPressed ;
18+ Control . PointerReleased += Control_PointerReleased ;
19+ }
20+ }
21+
22+ private void Control_PointerPressed ( object sender , Windows . UI . Xaml . Input . PointerRoutedEventArgs e )
23+ {
24+ VisualStateManager . GoToState ( Element , "Pressed" ) ;
25+ }
26+
27+ private void Control_PointerReleased ( object sender , Windows . UI . Xaml . Input . PointerRoutedEventArgs e )
28+ {
29+ VisualStateManager . GoToState ( Element , "Normal" ) ;
30+ }
31+ }
32+ }
You can’t perform that action at this time.
0 commit comments