Exemplo n.º 1
0
 protected Layout()
 {
     Children = new OwnedList <Layout>(this);
     Children.OnChildAdded(layout =>
     {
         layout.DataContext = DataContext;
         this.GetChangedObservable(DataContextProperty).Subscribe(o => layout.DataContext = o);
     });
     Pointer  = new PointerEvents(this, Platform.Current.EventDriver);
     Keyboard = new KeyboardEvents(this, Platform.Current.EventDriver, Platform.Current.FocusedElement);
 }
Exemplo n.º 2
0
        protected Layout(Platform platform)
        {
            Platform = platform;

            Children = new OwnedList <Layout>(this);
            Children.OnChildAdded(layout =>
            {
                layout.DataContext = DataContext;
                GetChangedObservable(DataContextProperty).Subscribe(o => layout.DataContext = o);
            });

            Pointer  = new PointerEvents(this, Platform.EventSource);
            Keyboard = new KeyboardEvents(this, Platform.EventSource, Platform.RenderSurface.FocusedElement);
            Style    = this.GetType().Name;
            this.NotifyRenderAffectedBy(BackgroundProperty, ForegroundProperty);
        }
Exemplo n.º 3
0
        protected Layout(IPropertyEngine propertyEngine)
        {
            PropertyEngine = propertyEngine;

            RegistrationGuard.RegisterFor <Layout>(() =>
            {
                DataContextProperty = DataContextProperty = PropertyEngine.RegisterProperty("DataContext", typeof(Layout), typeof(object), new PropertyMetadata());
            });

            Children = new OwnedList <Layout>(this);
            Children.OnChildAdded(layout =>
            {
                layout.DataContext = DataContext;
                GetChangedObservable(DataContextProperty).Subscribe(o => layout.DataContext = o);
            });
            Pointer  = new PointerEvents(this, Platform.Current.EventSource);
            Keyboard = new KeyboardEvents(this, Platform.Current.EventSource, Platform.Current.FocusedElement);
        }