/// <summary> /// Initializes a new instance of the <see cref="ApplicationBar" /> class. /// </summary> public ApplicationBar() { InternalApplicationBar = new Microsoft.Phone.Shell.ApplicationBar(); Buttons = new ApplicationBarIconButtonCollection(InternalApplicationBar.Buttons); MenuItems = new ApplicationBarMenuItemCollection(InternalApplicationBar.MenuItems); InternalApplicationBar.StateChanged += ApplicationBarStateChanged; }
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()); }