How can we improve the Windows Phone dev platform?

Enable Databindable ApplicationBar (buttons and menuitems)

Right now it's not easy to enable DataBinding on the ApplicationBar buttons and menuitems.

- When created in Xaml there's no way to get a reference to them, should be different.
- Should be easily bound to a command, same as for icon and text should be bindable.

894 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Mark MonsterMark Monster shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →
    Fabio SalvalaiFabio Salvalai shared a merged idea: Make Application Bar support Commanding  ·   · 

    12 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • TonyTony commented  ·   ·  Flag as inappropriate

        Also be able to databind to events from controls, such as a LongListSelector's SelectionChanged event would be nice.

      • MarvinMarvin commented  ·   ·  Flag as inappropriate

        Basically, ApplicationBar, ApplicationBarIconButton and ApplicationBarMenuItem only have to inherit from FrameworkElement and 'Text' and other properties be changed to 'DependencyProperty's.
        It would be very easy to write a BindableApplicationButton, if PhoneApplicationPage allowed an Application bar not only being ApplicationBar, but rather every type inherited of IApplicationBar.

        Greetings!

      • EugeniyEugeniy commented  ·   ·  Flag as inappropriate

        you can always write your own application bar
        Or you can write ApplicationBar wrapper, which will support binding and so on...

      • xaeryanxaeryan commented  ·   ·  Flag as inappropriate

        Lack of Commanding for ApplicationBar is a major annoyance for me, resulting in some less than ideal workarounds for updating Enabled status of these controls.

      • Richard SzalayRichard Szalay commented  ·   ·  Flag as inappropriate

        @Peter - Mark is likely referring to MVVM. As ApplicationBar buttons/icons are not DependencyObjects, they cannot be bound to. This requires adding code to the code behind, which can't be tested.

      • Peter WonePeter Wone commented  ·   ·  Flag as inappropriate

        No way to get a reference? Bollocks. Declare a page member.

        ApplicationBarIconButton appbar_buttonAddToFavourites;

        Then set it in OnNavigatedTo.

        appbar_buttonAddToFavourites = ApplicationBar.Buttons[0] as ApplicationBarIconButton;

        The buttons are indexed 0..3 in the order they are declared in XAML.

      • kkarmankkarman commented  ·   ·  Flag as inappropriate

        this suggestion was already mentioned. please remove it and vote for the other.

      • kkarmankkarman commented  ·   ·  Flag as inappropriate

        Also, I would like to have animations for the applicationbar as in the native e-mail client

      Feedback and Knowledge Base