使用xaml中的listbox更新wp8中的文本框

时间:2013-11-29 10:56:46

标签: c# xaml windows-phone-8 textbox listbox

我正在使用列表框从网址收集数据,我将在文本框中显示它。我需要在运行时根据需要更新文本框。

我的XAML代码..

<Grid x:Name="prayertimegrid" Grid.Row="1" HorizontalAlignment="Left" Width="456" ShowGridLines="True" Margin="10,0,0,0" Grid.ColumnSpan="2">

            <StackPanel HorizontalAlignment="Left" Height="536" Margin="11,10,-11,0" VerticalAlignment="Top" Width="456">
                <ListBox x:Name="editprayertime" Height="584" ItemsSource="{Binding Organization, Mode=TwoWay}">
                    <ListBox.ItemTemplate>
                        <DataTemplate>

                            <StackPanel>
                                <Grid x:Name="prayertime" HorizontalAlignment="Left" Height="680" Width="456" ShowGridLines="True">

                                    <TextBlock x:Name="txt_prayer1" HorizontalAlignment="Left" Height="39" Margin="0,70,0,0" TextWrapping="Wrap" Text="prayer1" VerticalAlignment="Top" Width="95" FontFamily="Segoe UI Semibold" FontSize="18" />
                                    <TextBox x:Name="data1" Text="{Binding data1, Mode=TwoWay}" HorizontalAlignment="Left" Height="68" Margin="100,60,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="333" FontFamily="Segoe UI Semibold" FontSize="18"/>

                                    <TextBlock x:Name="prayer2" HorizontalAlignment="Right" Height="40" Margin="0,131,367,0" TextWrapping="Wrap" Text="Dhuhr" VerticalAlignment="Top" Width="89" FontFamily="Segoe UI Semibold" FontSize="18"/>
                                    <TextBox x:Name="data2" Text="{Binding data2, Mode=TwoWay}" HorizontalAlignment="Left" Height="68" Margin="100,120,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="333" FontFamily="Segoe UI Semibold" FontSize="18"/>

                                    <TextBlock x:Name="prayer3" HorizontalAlignment="Left" Height="34" Margin="6,179,0,0" TextWrapping="Wrap" Text="prayer3" VerticalAlignment="Top" Width="89" FontFamily="Segoe UI Semibold" FontSize="18"/>
                                    <TextBox x:Name="data3" Text="{Binding data3, Mode=TwoWay}" HorizontalAlignment="Left" Height="68" Margin="100,170,0,0" TextWrapping="Wrap"  VerticalAlignment="Top" Width="333" FontFamily="Segoe UI Semibold" FontSize="18"/>


                                    <Button Content="Update" x:Name="btn_updateprayertime" Height="70" Width="150" Margin="134,474,172,136" Click="btn_updateprayertime_click"/>
                                </Grid>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </StackPanel>
</Grid>

如何更新文本框的内容......

0 个答案:

没有答案