Exemplo n.º 1
0
 public Page()
 {
     InitializeComponent();
     MyContentControl c = new MyContentControl ();
     LayoutRoot.Children.Add (c);
     DispatcherTimer timer = new DispatcherTimer { Interval = TimeSpan.Zero };
     timer.Tick += delegate {
         LayoutRoot.Children.Add (new TextBlock  { Text = c.Measured ? "Success" : "Failure - The control should've been measured" });
         timer.Stop ();
     };
     timer.Start ();
 }
Exemplo n.º 2
0
        public Page()
        {
            InitializeComponent();
            MyContentControl c = new MyContentControl();

            LayoutRoot.Children.Add(c);
            DispatcherTimer timer = new DispatcherTimer {
                Interval = TimeSpan.Zero
            };

            timer.Tick += delegate {
                LayoutRoot.Children.Add(new TextBlock  {
                    Text = c.Measured ? "Success" : "Failure - The control should've been measured"
                });
                timer.Stop();
            };
            timer.Start();
        }