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 3793182
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:44:11+00:00 2026-05-19T12:44:11+00:00

The sample code below for a button will trigger opening of a second page.

  • 0

The sample code below for a button will trigger opening of a second page.

            <Button x:Name="btnSelect" Content="Select" HorizontalAlignment="Right" Margin="0,8,20,6" 
                Grid.Row="2" Width="200">
            <Custom:Interaction.Triggers>
                <Custom:EventTrigger EventName="Click">
                    <GalaSoft_MvvmLight_Command:EventToCommand x:Name="btnSelectClicked" 
                                                               Command="{Binding SelectEventPageCommand, Mode=OneWay}"/>
                </Custom:EventTrigger>
            </Custom:Interaction.Triggers>
        </Button> 

    public partial class MainPage : PhoneApplicationPage
{
    // Constructor
    public MainPage()
    {
        InitializeComponent();
    }


    private void ContentGrid_Loaded(object sender, System.Windows.RoutedEventArgs e)
    {
        Messenger.Default.Register<GoToPageMessage>(this, (action) => ReceiveMessage(action));
    }

    private object ReceiveMessage(GoToPageMessage action)
    {
        StringBuilder sb = new StringBuilder("/Views/");
        sb.Append(action.PageName);
        sb.Append(".xaml");
        NavigationService.Navigate(
           new System.Uri(sb.ToString(),
                 System.UriKind.Relative));
        return null;
    }
}

http://galasoft.ch/mvvm/getstarted/

Can anyone suggest how I can do the same using an ApplicationBarIconButton? I get an error Property ‘Triggers’ is not attachable to elements of type ApplicationBarIconButton.

Or should I just use CodeBehind?

    <phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False">
        <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1">

        </shell:ApplicationBarIconButton>

    </shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
  • 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-05-19T12:44:11+00:00Added an answer on May 19, 2026 at 12:44 pm

    Yeap ApplicationBar is a little bit different fom other controls in Silverlight. I was able to use an ICommand by using this one:
    http://blog.humann.info/post/2010/08/27/How-to-have-binding-on-the-ApplicationBar.aspx

    or the Silverlight toolkit which offers some extensions as stated in this answer:
    How to add an application bar to a user control in wp7 but I never used it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below is sample code to create a radio button element with Yes/No options in
In the below code sample, what does {0:X2} mean? This is from the reflection
The code below shows a sample that I've used recently to explain the different
In the code sample below, if a user changes the contents of the JFormattedTextField
I'm making a simple Image Debugger Visualizer. Code is below. I'm not sure if
Below is the code of a simple html with a table layout. In FF
Sample code that shows how to create threads using MFC declares the thread function
Searching for some sample code for converting a point in WGS84 coordinate system to
Here is my sample code: from xml.dom.minidom import * def make_xml(): doc = Document()
Here is a sample code to retrieve data from a database using the yield

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.