Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9140031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:27:47+00:00 2026-06-17T09:27:47+00:00

I have an App Bar with some buttons like this <Page.BottomAppBar> <AppBar x:Name=bottomAppBar Padding=10,10,10,10

  • 0

I have an App Bar with some buttons like this

<Page.BottomAppBar>
    <AppBar x:Name="bottomAppBar" Padding="10,10,10,10"  >
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Style="{StaticResource ReadAppBarButtonStyle}"  >
            </Button>
        </StackPanel>
    </AppBar>
</Page.BottomAppBar>

I want to bind the button text to a selected item property of a ListView and use an IValueConverter.

I found that the button text is to be set using AutomationProperties.Name

how can I bind this property through XAML or Code.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T09:27:47+00:00Added an answer on June 17, 2026 at 9:27 am

    You’re right, for some reason the following doesn’t work, although the same binding works just fine you use it for e.g. Text property of a TextBox:

    <Button Style="{StaticResource SkipBackAppBarButtonStyle}" AutomationProperties.Name="{Binding SelectedItem, ElementName=List}" />
    

    I did manage to get it work by using a property in the view model and binding to it both ListView.SelectedItem and AutomationProperties.Name:

    <ListView ItemsSource="{Binding Strings}" 
              SelectedItem="{Binding SelectedString, Mode=TwoWay}" />
    <!-- ... -->
    <Button Style="{StaticResource SkipBackAppBarButtonStyle}" 
            AutomationProperties.Name="{Binding SelectedString}" />
    

    SelectedString should be a property in a view model implementing INotifyPropertyChanged:

    public class ViewModel : INotifyPropertyChanged
    {
        public ViewModel()
        {
            Strings = new ObservableCollection<string>();
            for (int i = 0; i < 50; i++)
            {
                Strings.Add("Value " + i);
            }
        }
    
        public ObservableCollection<string> Strings { get; set; }
    
        private string _selectedString;
        public string SelectedString
        {
            get { return _selectedString; }
            set
            {
                if (value == _selectedString) return;
                _selectedString = value;
                OnPropertyChanged();
            }
        }
    
        public event PropertyChangedEventHandler PropertyChanged;
    
        protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null) handler(this, new PropertyChangedEventArgs(propertyName));
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my app have action bar on top of windows. Where are some buttons. Buttons
In my app I have a tab bar. And in some views I as
I have a tab-bar and navigation controller application (like Youtube app or Contacts app).
I have a tab bar + navigation based app and I'd like to launch
I have an example like this: package android.uiexample; import android.app.Activity; import android.os.Bundle; import android.os.Handler;
I have in my app/views/bar/index.html.haml the following %p= render partial: 'foo', collection: @foos the
I have an app, which has a top navigation bar and a bottom tab
In my app I have a notification in the task bar and when clicked
I'm making a tab bar iphone app and I wanted to have an animated
I have created a flexible navigation bar in my app that will show custom

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.