Get TextBox text from DataTemplate in App.xaml

MANKEAGEDDYNC

New Member
I'm developing Windows Phone 7 application and i have on one of pages this code (details.xaml):\[code\]<StackPanel x:Name="ContentPanel" Grid.Row="1" Margin="12,45,12,12" Orientation="Horizontal"> <ItemsControl x:Name="UserList" ItemTemplate="{StaticResource UserDataTemplate}" /></StackPanel>\[/code\]In App.xaml I have this:\[code\]<DataTemplate x:Key="UserDataTemplate" x:Name="datatemp"> <StackPanel> <TextBlock Height="27" Margin="0,0,0,0" Grid.Row="1" TextWrapping="Wrap" Text="Record index:" VerticalAlignment="Top" Foreground="#FF6C6C6C"/> <TextBox Text="{Binding Index}" x:Name="index_box_det" Height="65" Margin="-12,-10,0,0" Grid.Row="1" TextWrapping="Wrap" VerticalAlignment="Top" Foreground="#FF40AA2F" HorizontalAlignment="Left" Width="467" SelectionBackground="#FF40AA2F" SelectionForeground="White" BorderBrush="#FF3FA92E" FontSize="18.667"/> </StackPanel></DataTemplate>\[/code\]And in App.xaml.cs I have to get "index_box_det" text value, I read much pages about this subject but I nothing really found. Somebody know how to get this text value? When I'm using this:\[code\]var index = (((sender as FrameworkElement).DataContext as Person).Index);\[/code\]I get only value from binding, not after editing textbox. Please help!
 
Back
Top