C# Class BindableApplicationBar.BindableApplicationBar

Inheritance: System.Windows.Controls.Control
Show file Open project: nokiadatagathering/WP7-Official Class Usage Examples

Public Properties

Property Type Description
BackgroundColorProperty System.Windows.DependencyProperty
BindableOpacityProperty System.Windows.DependencyProperty
ButtonTemplateProperty System.Windows.DependencyProperty
ButtonsProperty System.Windows.DependencyProperty
ButtonsSourceProperty System.Windows.DependencyProperty
ForegroundColorProperty System.Windows.DependencyProperty
IsMenuEnabledProperty System.Windows.DependencyProperty
IsMenuVisibleProperty System.Windows.DependencyProperty
IsVisibleProperty System.Windows.DependencyProperty
MenuItemTemplateProperty System.Windows.DependencyProperty
MenuItemsProperty System.Windows.DependencyProperty
MenuItemsSourceProperty System.Windows.DependencyProperty
ModeProperty System.Windows.DependencyProperty

Public Methods

Method Description
Attach ( PhoneApplicationPage parentPage ) : void

Attaches the BindableApplicationBar to the specified page, creating the ApplicationBar if required and adding the buttons and menu items specified in the Buttons and MenuItems properties.

BindableApplicationBar ( ) : System

Initializes a new instance of the BindableApplicationBar class.

Detach ( PhoneApplicationPage parentPage ) : void

Detaches from the specified page, removing all the buttons and menu items specified in the Buttons and MenuItems properties.

Note: The code in this method has not been tested and is likely not to work properly, will possibly raise exceptions and leak memory.

Protected Methods

Method Description
OnBackgroundColorChanged ( Color oldBackgroundColor, Color newBackgroundColor ) : void

Provides derived classes an opportunity to handle changes to the BackgroundColor property.

OnBindableOpacityChanged ( double oldBindableOpacity, double newBindableOpacity ) : void

Provides derived classes an opportunity to handle changes to the BindableOpacity property.

OnButtonTemplateChanged ( System.Windows.DataTemplate oldButtonTemplate, System.Windows.DataTemplate newButtonTemplate ) : void

Provides derived classes an opportunity to handle changes to the ButtonTemplate property.

OnButtonsChanged ( DependencyObjectCollection oldButtons, DependencyObjectCollection newButtons ) : void

Provides derived classes an opportunity to handle changes to the Buttons property.

OnButtonsSourceChanged ( IEnumerable oldButtonsSource, IEnumerable newButtonsSource ) : void

Provides derived classes an opportunity to handle changes to the ButtonsSource property.

OnForegroundColorChanged ( Color oldForegroundColor, Color newForegroundColor ) : void

Provides derived classes an opportunity to handle changes to the ForegroundColor property.

OnIsMenuEnabledChanged ( bool oldIsMenuEnabled, bool newIsMenuEnabled ) : void

Provides derived classes an opportunity to handle changes to the IsMenuEnabled property.

OnIsMenuVisibleChanged ( bool oldIsMenuVisible, bool newIsMenuVisible ) : void

Provides derived classes an opportunity to handle changes to the IsMenuVisible property.

OnIsVisibleChanged ( bool oldIsVisible, bool newIsVisible ) : void

Provides derived classes an opportunity to handle changes to the IsVisible property.

OnMenuItemTemplateChanged ( System.Windows.DataTemplate oldMenuItemTemplate, System.Windows.DataTemplate newMenuItemTemplate ) : void

Provides derived classes an opportunity to handle changes to the MenuItemTemplate property.

OnMenuItemsChanged ( DependencyObjectCollection oldMenuItems, DependencyObjectCollection newMenuItems ) : void

Provides derived classes an opportunity to handle changes to the MenuItems property.

OnMenuItemsSourceChanged ( IEnumerable oldMenuItemsSource, IEnumerable newMenuItemsSource ) : void

Provides derived classes an opportunity to handle changes to the MenuItemsSource property.

OnModeChanged ( ApplicationBarMode oldMode, ApplicationBarMode newMode ) : void

Provides derived classes an opportunity to handle changes to the Mode property.

Private Methods

Method Description
ApplicationBarStateChanged ( object sender, Microsoft.Phone.Shell.ApplicationBarStateChangedEventArgs e ) : void
AttachButton ( BindableApplicationBarButton button, int i ) : void
AttachButtons ( IEnumerable buttons ) : void
AttachMenuItem ( BindableApplicationBarMenuItem menuItem, int i ) : void
AttachMenuItems ( IEnumerable menuItems ) : void
ButtonsCollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void
ButtonsSourceCollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void
DetachButton ( BindableApplicationBarButton button ) : void
DetachButtons ( IEnumerable buttons ) : void
DetachMenuItem ( BindableApplicationBarMenuItem menuItem ) : void
DetachMenuItems ( IEnumerable menuItems ) : void
GenerateButtonsFromSource ( ) : void
GenerateMenuItemsFromSource ( ) : void
MenuItemsCollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void
MenuItemsSourceCollectionChanged ( object sender, NotifyCollectionChangedEventArgs e ) : void
OnBackgroundColorChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the BackgroundColor property.

OnBindableOpacityChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the BindableOpacity property.

OnButtonTemplateChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the ButtonTemplate property.

OnButtonsChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the Buttons property.

OnButtonsSourceChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the ButtonsSource property.

OnForegroundColorChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the ForegroundColor property.

OnIsMenuEnabledChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the IsMenuEnabled property.

OnIsMenuVisibleChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the IsMenuVisible property.

OnIsVisibleChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the IsVisible property.

OnMenuItemTemplateChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the MenuItemTemplate property.

OnMenuItemsChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the MenuItems property.

OnMenuItemsSourceChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the MenuItemsSource property.

OnModeChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Handles changes to the Mode property.

OnPageLoaded ( object sender, RoutedEventArgs e ) : void
OnPageNavigating ( object sender, System e ) : void
SetButtonsEnabled ( ) : void
SynchronizeProperties ( ) : void

Method Details

Attach() public method

Attaches the BindableApplicationBar to the specified page, creating the ApplicationBar if required and adding the buttons and menu items specified in the Buttons and MenuItems properties.
public Attach ( PhoneApplicationPage parentPage ) : void
parentPage PhoneApplicationPage The parentPage to attach to.
return void

BindableApplicationBar() public method

Initializes a new instance of the BindableApplicationBar class.
public BindableApplicationBar ( ) : System
return System

Detach() public method

Detaches from the specified page, removing all the buttons and menu items specified in the Buttons and MenuItems properties.
Note: The code in this method has not been tested and is likely not to work properly, will possibly raise exceptions and leak memory.
public Detach ( PhoneApplicationPage parentPage ) : void
parentPage PhoneApplicationPage The parentPage.
return void

OnBackgroundColorChanged() protected method

Provides derived classes an opportunity to handle changes to the BackgroundColor property.
protected OnBackgroundColorChanged ( Color oldBackgroundColor, Color newBackgroundColor ) : void
oldBackgroundColor Color /// The old BackgroundColor value. ///
newBackgroundColor Color /// The new BackgroundColor value. ///
return void

OnBindableOpacityChanged() protected method

Provides derived classes an opportunity to handle changes to the BindableOpacity property.
protected OnBindableOpacityChanged ( double oldBindableOpacity, double newBindableOpacity ) : void
oldBindableOpacity double /// The old BindableOpacity value. ///
newBindableOpacity double /// The new BindableOpacity value. ///
return void

OnButtonTemplateChanged() protected method

Provides derived classes an opportunity to handle changes to the ButtonTemplate property.
protected OnButtonTemplateChanged ( System.Windows.DataTemplate oldButtonTemplate, System.Windows.DataTemplate newButtonTemplate ) : void
oldButtonTemplate System.Windows.DataTemplate The old button template.
newButtonTemplate System.Windows.DataTemplate The new button template.
return void

OnButtonsChanged() protected method

Provides derived classes an opportunity to handle changes to the Buttons property.
protected OnButtonsChanged ( DependencyObjectCollection oldButtons, DependencyObjectCollection newButtons ) : void
oldButtons DependencyObjectCollection The old buttons.
newButtons DependencyObjectCollection The new buttons.
return void

OnButtonsSourceChanged() protected method

Provides derived classes an opportunity to handle changes to the ButtonsSource property.
protected OnButtonsSourceChanged ( IEnumerable oldButtonsSource, IEnumerable newButtonsSource ) : void
oldButtonsSource IEnumerable The old buttons source.
newButtonsSource IEnumerable The new buttons source.
return void

OnForegroundColorChanged() protected method

Provides derived classes an opportunity to handle changes to the ForegroundColor property.
protected OnForegroundColorChanged ( Color oldForegroundColor, Color newForegroundColor ) : void
oldForegroundColor Color /// The old ForegroundColor value. ///
newForegroundColor Color /// The new ForegroundColor value. ///
return void

OnIsMenuEnabledChanged() protected method

Provides derived classes an opportunity to handle changes to the IsMenuEnabled property.
protected OnIsMenuEnabledChanged ( bool oldIsMenuEnabled, bool newIsMenuEnabled ) : void
oldIsMenuEnabled bool /// The old IsMenuEnabled value. ///
newIsMenuEnabled bool /// The new IsMenuEnabled value. ///
return void

OnIsMenuVisibleChanged() protected method

Provides derived classes an opportunity to handle changes to the IsMenuVisible property.
protected OnIsMenuVisibleChanged ( bool oldIsMenuVisible, bool newIsMenuVisible ) : void
oldIsMenuVisible bool /// The old IsMenuVisible value. ///
newIsMenuVisible bool /// The new IsMenuVisible value. ///
return void

OnIsVisibleChanged() protected method

Provides derived classes an opportunity to handle changes to the IsVisible property.
protected OnIsVisibleChanged ( bool oldIsVisible, bool newIsVisible ) : void
oldIsVisible bool The old IsVisible value.
newIsVisible bool The new IsVisible value.
return void

OnMenuItemTemplateChanged() protected method

Provides derived classes an opportunity to handle changes to the MenuItemTemplate property.
protected OnMenuItemTemplateChanged ( System.Windows.DataTemplate oldMenuItemTemplate, System.Windows.DataTemplate newMenuItemTemplate ) : void
oldMenuItemTemplate System.Windows.DataTemplate /// The old MenuItemTemplate value. ///
newMenuItemTemplate System.Windows.DataTemplate /// The new MenuItemTemplate value. ///
return void

OnMenuItemsChanged() protected method

Provides derived classes an opportunity to handle changes to the MenuItems property.
protected OnMenuItemsChanged ( DependencyObjectCollection oldMenuItems, DependencyObjectCollection newMenuItems ) : void
oldMenuItems DependencyObjectCollection The old menu items.
newMenuItems DependencyObjectCollection The new menu items.
return void

OnMenuItemsSourceChanged() protected method

Provides derived classes an opportunity to handle changes to the MenuItemsSource property.
protected OnMenuItemsSourceChanged ( IEnumerable oldMenuItemsSource, IEnumerable newMenuItemsSource ) : void
oldMenuItemsSource IEnumerable /// The old MenuItemsSource value. ///
newMenuItemsSource IEnumerable /// The new MenuItemsSource value. ///
return void

OnModeChanged() protected method

Provides derived classes an opportunity to handle changes to the Mode property.
protected OnModeChanged ( ApplicationBarMode oldMode, ApplicationBarMode newMode ) : void
oldMode ApplicationBarMode The old Mode value.
newMode ApplicationBarMode The new Mode value.
return void

Property Details

BackgroundColorProperty public static property

BackgroundColor Dependency Property
public static DependencyProperty,System.Windows BackgroundColorProperty
return System.Windows.DependencyProperty

BindableOpacityProperty public static property

BindableOpacity Dependency Property
public static DependencyProperty,System.Windows BindableOpacityProperty
return System.Windows.DependencyProperty

ButtonTemplateProperty public static property

ButtonTemplate Dependency Property
public static DependencyProperty,System.Windows ButtonTemplateProperty
return System.Windows.DependencyProperty

ButtonsProperty public static property

Buttons Dependency Property
public static DependencyProperty,System.Windows ButtonsProperty
return System.Windows.DependencyProperty

ButtonsSourceProperty public static property

ButtonsSource Dependency Property
public static DependencyProperty,System.Windows ButtonsSourceProperty
return System.Windows.DependencyProperty

ForegroundColorProperty public static property

ForegroundColor Dependency Property
public static DependencyProperty,System.Windows ForegroundColorProperty
return System.Windows.DependencyProperty

IsMenuEnabledProperty public static property

IsMenuEnabled Dependency Property
public static DependencyProperty,System.Windows IsMenuEnabledProperty
return System.Windows.DependencyProperty

IsMenuVisibleProperty public static property

IsMenuVisible Dependency Property
public static DependencyProperty,System.Windows IsMenuVisibleProperty
return System.Windows.DependencyProperty

IsVisibleProperty public static property

IsVisible Dependency Property
public static DependencyProperty,System.Windows IsVisibleProperty
return System.Windows.DependencyProperty

MenuItemTemplateProperty public static property

MenuItemTemplate Dependency Property
public static DependencyProperty,System.Windows MenuItemTemplateProperty
return System.Windows.DependencyProperty

MenuItemsProperty public static property

MenuItems Dependency Property
public static DependencyProperty,System.Windows MenuItemsProperty
return System.Windows.DependencyProperty

MenuItemsSourceProperty public static property

MenuItemsSource Dependency Property
public static DependencyProperty,System.Windows MenuItemsSourceProperty
return System.Windows.DependencyProperty

ModeProperty public static property

Mode Dependency Property
public static DependencyProperty,System.Windows ModeProperty
return System.Windows.DependencyProperty