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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:36:56+00:00 2026-05-22T18:36:56+00:00

When the Complete Survey button on the Expander.Header is clicked, I would like to

  • 0

When the Complete Survey button on the Expander.Header is clicked, I would like to Navigate to another page and pass along some information from the viewmodel. I have the expander working so that when its selected it expands, and the selecteditem property is properly bound and filled. However if I just click right to the button, the selecteditem does not change and is not even populated if its the first action. How can I trigger the selected item if the button control is pressed before the expander is selected? I would prefer an MVVM solution if possible. Thanks

<ListBox  x:Name="SearchList"
                          Grid.Row="1"
                          Margin="5,0,5,0"
                          Grid.Column="0"
                          Background="Transparent"
                          BorderThickness="0"
                          BorderBrush="Transparent"
                          ItemsSource="{Binding Path=SearchResults}"
                          SelectedItem="{Binding Path=SelectedResult,Mode=TwoWay,Converter={StaticResource DebugConverter}}"
                          HorizontalContentAlignment="Stretch"
                          HorizontalAlignment="Stretch">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <toolkit:Expander>
                                <sb:BindingHelper.Binding>
                                    <sb:RelativeSourceBinding TargetProperty="IsExpanded"
                                                              Path="IsSelected"
                                                              RelativeMode="FindAncestor"
                                                              AncestorType="ListBoxItem" BindingMode="TwoWay" />
                                </sb:BindingHelper.Binding>
                                <toolkit:Expander.Header>
                                    <Grid Width="525">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="25" />
                                            <ColumnDefinition Width="100" />
                                        </Grid.ColumnDefinitions>
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="*" />
                                        </Grid.RowDefinitions>
                                        <TextBlock Grid.Column="0"
                                                   Grid.Row="0"
                                                   Text="{Binding Path=PatientName}" />
                                        <Button Grid.Column="2"
                                                Grid.Row="0"
                                                Content="Complete Survey">
                                            <sb:BindingHelper.Binding>
                                                <sb:RelativeSourceBinding Path="OpenSurveyCommand"
                                                                          TargetProperty="Command"
                                                                          RelativeMode="ParentDataContext" />
                                            </sb:BindingHelper.Binding>
                                        </Button>
                                    </Grid>
                                </toolkit:Expander.Header>
                                <StackPanel>
                                    <TextBlock Text="{Binding MRN,Converter={StaticResource StringLabelConverter},ConverterParameter=MRN}" />
                                    <TextBlock Text="{Binding OriginalVisitNumber,Converter={StaticResource StringLabelConverter},ConverterParameter='Original Visit Number'}" />
                                    <TextBlock Text="{Binding OriginalAdmitDate,Converter={StaticResource StringLabelConverter},ConverterParameter='Original Admit Date'}" />
                                    <TextBlock Text="{Binding OriginalReason,Converter={StaticResource StringLabelConverter},ConverterParameter='Original Reason'}" />
                                    <TextBlock Text="{Binding ReAdmitVisitNumber,Converter={StaticResource StringLabelConverter},ConverterParameter='ReAdmit Visit Number'}" />
                                    <TextBlock Text="{Binding ReAdmitDate,Converter={StaticResource StringLabelConverter},ConverterParameter='Readmit Date'}" />
                                    <TextBlock Text="{Binding ReAdmitReason,Converter={StaticResource StringLabelConverter},ConverterParameter='ReAdmit Reason'}" />
                                </StackPanel>

                            </toolkit:Expander>


                        </DataTemplate>
                    </ListBox.ItemTemplate>
  • 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-22T18:36:57+00:00Added an answer on May 22, 2026 at 6:36 pm

    Using a collection of viewmodels with the button in the viewmodel solved this. No special magic other than the ObservableCollectionVM

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

Sidebar

Related Questions

I have a complete XML document in a string and would like a Document
I have a radio button group on a survey form whose html looks like:
To complete some testing I need to load the 64 bit version of an
I'm using JSON.Net to try and deserialize some survey responses from SurveyGizmo. Here's a
The complete code is on https://gist.github.com/1341623 I'd like to sort an index array (or
Complete sql noob here. Trying to think about a way to store some data
I have a button in my Header of the HeaderedContentControl When i click on
I'd like to build a simple survey/questionnaire app in Ruby on Rails and wanted
Im currently reading Code Complete by Steve McConnell, specifically page 295 on floating-point numbers.
Complete C# newbie here, so cut me some slack. I have this application that

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.