public ApplicationCanvas()
        {
            r.Fill = Brushes.Red;
            r.AttachTo(this);
            r.MoveTo(8, 8);
            this.SizeChanged += (s, e) => r.SizeTo(this.Width - 16.0, this.Height - 16.0);

            var btn = new Button { Content = "Hello" }.MoveTo(16, 16).SizeTo(96, 32);

            btn.Click +=
                delegate
                {

                    var w = new Window();

                    //w = new ApplicationCanvas().ToW
                    w.Content = new ApplicationCanvas();

                    w.ShowInTaskbar = false;

                    var p = this.Parent as FrameworkElement;

                    while (!(p is Window))
                    {
                        p = p.Parent as FrameworkElement;
                    }

                    var Owner = p as Window;

                    w.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                    w.Owner = Owner;

                    w.ShowDialog();

                };

            btn.AttachTo(this);
        }
Example #2
0
        public static void Main(string[] e)
        {
            var w = new Window { Title = "JSC - Android Project" }.SizeTo(400 + 48, 300);

            var c = new Canvas();

            c.AttachTo(w);


            new global::AndroidVortexLesson1.Avalon.Images.jsc().AttachTo(c).MoveTo(300, 16);

            var button1 = new Button { Content = "Debug in Android Emulator" };

            button1.MoveTo(16, 128).SizeTo(400, 32);
            button1.AttachTo(c);

            var button2 = new Button { Content = "Debug on Device" };

            button2.MoveTo(16, 128 + 48).SizeTo(400, 32);
            button2.AttachTo(c);

            w.ShowDialog();
        }