locked
Data binding problem for ListView on Flyout? RRS feed

  • Question

  • I have a ListView on a Flyout.  It's not seeing updates from the object it's ItemsSource is set to.  As a test I made a duplicate listbox on the main page grid and attached it's ItemsSource to the exact same object.  It works fine.  Even stranger, when I break into the debugger after I can see the duplicate ListView is clearly populated, the ItemsSource property of the flyout ListView is null , despite triple-checking the XAML to make sure it's data source is set.

    I have another thread here about a similar problem with a Rectangle on a flyout not working as a expected.  Are many important operations just not available on Flyout child controls?

    Here's the XAML snippets for the flyout and duplicate ListView controls:

    PRIMAY LISTVIEW (on flyout)

    <ListView x:Name="listAltSpeechResults" Grid.Row="1" ItemsSource="{Binding Alternates, ElementName=speechRecoControl, Mode=OneWay}" ItemTemplate="{StaticResource datatempAltSearchResults}"/>
    

    DUPLICATE LISTVIEW (not on flyout)

    <ListView x:Name="listAltSearchResults_temp" Grid.Column="1" HorizontalAlignment="Left" Height="502" Margin="86,82,0,0" VerticalAlignment="Top" Width="430" ItemsSource="{Binding Alternates, ElementName=speechRecoControl, Mode=OneWay}" ItemTemplate="{StaticResource datatempAltSearchResults}"/>


    -- roschler

    Friday, February 7, 2014 12:06 PM

All replies

  • Hi,roschler

    Would you mind uploading a simple project into skyDrive? So that we can test it and make sure why the problem occur!

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, February 10, 2014 3:21 AM
  • Isn't it the same problem as this?:

    http://social.msdn.microsoft.com/Forums/windowsapps/en-US/2368aea1-e25d-412b-a6ed-483597b7448a/rendertargetbitmaploadasync-fails-with-uielement-on-a-flyout-value-out-of-range


    -- roschler

    Monday, February 10, 2014 2:38 PM
  • The problems don't appear to be related. The other was specifically about rendering.

    Making a bit of a guess since you didn't provide full information, but it sounds like your speechRecoControl is out of he scope of your fly out. See the Binding.ElementName docs. Move the speechRecoControl onto the fly out and that version will work but the non-fly out one will fail.

    Monday, February 10, 2014 3:16 PM
    Moderator
  • Hello Rob,

    The speech reco control is on the Flyout:

     <Flyout x:Name="flyoutAddVideomark" Placement="Bottom" FlyoutPresenterStyle="{StaticResource FlyoutWideStyle1}" Opening="flyoutAddVideomark_Opening" Closed="flyoutAddVideomark_Closed" >
                <Grid x:Name="gridOuter" Height="310" >
                    <Popup x:Name="popupAltSpeechResults" Width="426" Height="305" HorizontalAlignment="Center" VerticalAlignment="Center" IsLightDismissEnabled="True">
                        <Border BorderBrush="#DE0BC313" BorderThickness="2" Width="404" Height="301" Background="#FFD9E8D6">
                            <StackPanel x:Name="stackPopup">
                                <TextBlock x:Name="lblAltChoices" TextWrapping="Wrap" Text="Alternate choices" FontSize="22" Margin="10,0"/>
                                <ListView x:Name="listAltSpeechResults" 
                                          ItemsSource="{Binding ItemsSource, ElementName=listAltRecoText_temp}" 
                                          ItemTemplate="{StaticResource datatempAltSearchResults}" 
                                          SelectionMode="Single" 
                                          Margin="10" 
                                          SelectionChanged="listAltSpeechResults_SelectionChanged"/>
                            </StackPanel>
                        </Border>
                    </Popup>
                    <StackPanel x:Name="stackAddVideomark" Orientation="Horizontal" Background="#FF363636" Margin="10,0" >
                        <Rectangle x:Name="rectVideomarkThumbnail" Fill="#FFF4F4F5" Stroke="Black" Margin="10,10,10,7" Width="299"/>
                        <StackPanel x:Name="stackNoteField" Height="284">
                            <TextBlock x:Name="lblVideomarkLocation" TextWrapping="Wrap" Text="TextBlock" FontSize="24" Grid.Row="2" Margin="5,0,10,10" Foreground="#FF51BAEC"/>
                            <TextBox x:Name="txtVideomarkNote" Grid.Row="3" TextWrapping="Wrap" Margin="10,0" Width="341" Height="189" />
                            <Button x:Name="btnOk" Content="Add Videomark" Grid.Row="4" Foreground="White" FontSize="21.333" Click="btnOk_Click" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="111,0" BorderThickness="0,5,0,0"/>
                        </StackPanel>
                        <StackPanel x:Name="stackSpeechReco" Width="252" Orientation="Vertical" HorizontalAlignment="Center" VerticalAlignment="Center" Height="290" Margin="0,10">
                            <SpeechRecoControl:SpeechRecoControl x:Name="speechRecoControl2" Height="119" Margin="18,0,17,0"/>
                            <StackPanel Orientation="Horizontal" x:Name="stackEditDeleteRecoText" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0" IsHitTestVisible="False" Margin="10,0,0,0" Width="212">
                                <Controls:ImageButton x:Name="imgEditVideomark2" NormalStateImageSource="ms-appx:///Assets/Images/icons/edit-unpressed-new.png" PressedStateImageSource="ms-appx:///Assets/Images/icons/edit-pressed-new.png" Margin="-1,0,0,0" 
                        		    Click="imgEditRecoText_Click" Height="75" Width="75" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                <Controls:ImageButton x:Name="imgDeleteVideomark2" Grid.Row="1" NormalStateImageSource="ms-appx:///Assets/Images/icons/delete-unpressed.png" PressedStateImageSource="ms-appx:///Assets/Images/icons/delete-pressed.png" Grid.Column="1" 
                        		    Click="imgDeleteRecoText_Click" Width="75" Height="75" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                <Controls:ImageButton x:Name="imgPeriodVideomark" NormalStateImageSource="ms-appx:///Assets/Images/icons/period-unpressed.png" PressedStateImageSource="ms-appx:///Assets/Images/icons/period-pressed.png" Margin="-1,0,0,0" Click="imgPeriodVideomark_Click" Width="75" Height="75" />
                            </StackPanel>
    						<StackPanel x:Name="stackPreRoll" Orientation="Horizontal" Height="94" >
    							<ToggleSwitch x:Name="togglePreRoll" Header="Jump back 10 seconds" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#FFF0DFDF" Width="240" Margin="5,0,0,0" FontSize="24" IsOn="true" Toggled="togglePreRoll_Toggled" />
    						</StackPanel>
                        </StackPanel>
                    </StackPanel>
                    <Popup VerticalOffset="10" HorizontalOffset="200" x:Name="StandardPopup">
                        <Border BorderBrush="{StaticResource ApplicationForegroundThemeBrush}" BorderThickness="2" Background="{StaticResource ApplicationPageBackgroundThemeBrush}" Width="200" Height="200">
                            <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
                                <TextBlock Text="Simple Popup" FontSize="24.667" HorizontalAlignment="Center" />
                            </StackPanel>
                        </Border>
                    </Popup>
                </Grid>
            </Flyout>


    -- roschler

    Monday, February 10, 2014 3:44 PM