Exemplo n.º 1
0
        public ApplicationBar()
        {
            _buttons   = new ApplicationBarIconButtonCollection();
            _menuItems = new ApplicationBarMenuItemCollection();
            _sysAppBar = new Microsoft.Phone.Shell.ApplicationBar();

            // Bind artificial DataContext property with DataContext from visual tree so non-visual children will have the same DataContext.
            // This is to compansate the lack of inheritance-context in Silverlight.
            BindingOperations.SetBinding(this, ApplicationBar.DataContextProperty, new Binding());
        }
Exemplo n.º 2
0
        public ApplicationBar()
        {
            _buttons = new ApplicationBarIconButtonCollection();
            _menuItems = new ApplicationBarMenuItemCollection();
            _sysAppBar = new Microsoft.Phone.Shell.ApplicationBar();

            // Bind artificial DataContext property with DataContext from visual tree so non-visual children will have the same DataContext.
            // This is to compansate the lack of inheritance-context in Silverlight.
            BindingOperations.SetBinding(this, ApplicationBar.DataContextProperty, new Binding());                        
        }