예제 #1
0
        public OwnerDrawControl(
            IDrawDelegate drawDelegate)
        {
            if (null == drawDelegate)
            {
                throw new ArgumentNullException(nameof(drawDelegate));
            }

            this._drawDelegate = drawDelegate;

            this.Loaded      += Control_Loaded;
            this.Unloaded    += Control_Unloaded;
            this.SizeChanged += Control_SizeChanged;

            // Specify a custom control template that respects the Background property and enables hit testing
            var controlTemplate = (ControlTemplate)global::Windows.UI.Xaml.Application.Current.Resources["OwnerDrawControlTemplate"];

            this.Template = controlTemplate;

            // HACK: Enable hit testing
            this.Background = new global::Windows.UI.Xaml.Media.SolidColorBrush(global::Windows.UI.Colors.Transparent);

            this._graphicsManager         = GraphicsManager.Shared;
            this._graphicsManager.Redraw += GraphicsManager_Redraw;
        }
예제 #2
0
        internal OwnerDrawControl(
            IDrawDelegate drawDelegate)
        {
            if (null == drawDelegate)
            {
                throw new ArgumentNullException(nameof(drawDelegate));
            }

            this._drawDelegate = drawDelegate;
        }
예제 #3
0
        internal OwnerDrawControl(
            global::Android.Content.Context context,
            IDrawDelegate drawDelegate)
            : base(context)
        {
            if (null == drawDelegate)
            {
                throw new ArgumentNullException(nameof(drawDelegate));
            }

            this._drawDelegate = drawDelegate;
        }
예제 #4
0
 public PhysicsDrawView(IDrawDelegate drawDelegate, cpSpace space)
 {
     this.drawDelegate = drawDelegate;
 }