summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.ControlGallery.WindowsUniversal/_57114Renderer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.ControlGallery.WindowsUniversal/_57114Renderer.cs')
-rw-r--r--Xamarin.Forms.ControlGallery.WindowsUniversal/_57114Renderer.cs48
1 files changed, 48 insertions, 0 deletions
diff --git a/Xamarin.Forms.ControlGallery.WindowsUniversal/_57114Renderer.cs b/Xamarin.Forms.ControlGallery.WindowsUniversal/_57114Renderer.cs
new file mode 100644
index 00000000..94032094
--- /dev/null
+++ b/Xamarin.Forms.ControlGallery.WindowsUniversal/_57114Renderer.cs
@@ -0,0 +1,48 @@
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Xamarin.Forms.ControlGallery.WindowsUniversal;
+using Xamarin.Forms.Controls.Issues;
+using Xamarin.Forms.Platform.UWP;
+
+[assembly: ExportRenderer(typeof(Bugzilla57114._57114View), typeof(_57114Renderer))]
+
+namespace Xamarin.Forms.ControlGallery.WindowsUniversal
+{
+ public class _57114Renderer : VisualElementRenderer<Bugzilla57114._57114View, _57114NativeView>
+ {
+ protected override void OnElementChanged(ElementChangedEventArgs<Bugzilla57114._57114View> e)
+ {
+ if (e.NewElement != null && Control == null)
+ {
+ var view = new _57114NativeView();
+ SetNativeControl(view);
+
+ }
+
+ base.OnElementChanged(e);
+
+ if (Control != null)
+ {
+ Control.Background = ColorToBrush(Element.BackgroundColor);
+ }
+ }
+
+ Brush ColorToBrush(Color color)
+ {
+ return new SolidColorBrush(Windows.UI.Color.FromArgb((byte)(color.A * 255), (byte)(color.R * 255), (byte)(color.G * 255), (byte)(color.B * 255)));
+ }
+ }
+
+ public class _57114NativeView : Windows.UI.Xaml.Controls.Grid
+ {
+ public _57114NativeView()
+ {
+ Tapped += OnTapped;
+ }
+
+ void OnTapped(object sender, TappedRoutedEventArgs tappedRoutedEventArgs)
+ {
+ MessagingCenter.Send(this as object, Bugzilla57114._57114NativeGestureFiredMessage);
+ }
+ }
+} \ No newline at end of file