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

The Archive Base Latest Questions

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

I have very strange issue. In my WP7 app I have a pivot control

  • 0

I have very strange issue. In my WP7 app I have a pivot control and an item template defined inside it(or in the resources, I have tried both ways, but still same issue). In the template I have a regular button with EventToCommand defined(EventName=”Click”). I also have the same copy-pasted button outside the Pivot. The problem is that the button, which is outside the pivot is working ok, but the one inside doesn’t work. Actually I have noticed, that any command inside my pivot doesn’t work. I am handling correctly the Command in the ViewModel, because the same button, but outside the pivot is working great.
Any ideas what might be the problem? Help, please.
Thanks in advance.
Cheers.

P.S. My code is pretty standard, but just in case here it is:

    <controls:Pivot Grid.Row="0"
        x:Name="PivotControl"
        Title="{Binding ApplicationTitle}"                         
        ItemsSource="{Binding BlaBla}">

        <controls:Pivot.ItemTemplate>
            <DataTemplate>
                <StackPanel>
                   <Button Content="Click Me">
                        <i:Interaction.Triggers>
                            <i:EventTrigger EventName="Click">
                                <cmd:EventToCommand Command="{Binding MyCommand, Mode=OneWay}" CommandParameterValue="Test"/>
                            </i:EventTrigger>
                        </i:Interaction.Triggers>
                    </Button>
           ...

And the ViewModel code:

public RelayCommand<string> MyCommand
    {
        get;
        private set;
    }
//And in the constructor ...
MyCommand= new RelayCommand<string>((param) => HandleTheCommand(param));

…

Thanks again.

  • 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:08:29+00:00Added an answer on May 19, 2026 at 12:08 pm

    The problem with silverlight / WP7 is that data context is not inherited within templates. After using reflector to dig into MVVM lite codebase I found that there is a nifty trick to make it work. Basically instead of exposing ICommand in the original scenario, expose the dependency property of type Binding. Then any entity can be bound to this property because Binding can evaluate data context from the visual tree. Then create a observable binding class which basically has a hidden attached property bound to the Binding of the dependency property from the TriggerAction class. Now you need to do two things:
    1. In TriggerAction class if Binding DP changes, update ObservableBinding member
    2. In ObserableBinding class, if hidden DP changes, evaluate and store the new value.

    I hope that solves your problem as well.

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

Sidebar

Related Questions

I have a very strange issue with Daylight Savings Time (DST) in my app.
I have a very strange issue on my hands. I have two IIS websites
I am facing a very strange issue. I have a SharePoint webpart that displays
I have a very strange issue that I'm hoping someone can help me with.
I have this very strange issue with my MVC 2 project. Often times, I'll
I have encountered a very strange issue. Whenever I use the .NET membership provider
I have ran into a very strange issue with Google Maps in Chrome 5.0.375.99:
Very strange issue... I have something like this in my Controller: public ActionResult Initialize(IEnumerable<MyModel>
I am facing very strange issue. When I was running my app in iPhone
i have encountered a very strange issue: i use json.dump to write a file

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.