c#


Pass text of Listview.ItemTemplate to antoher frame uwp


I have to pass the Text={Binding Id}of textBlock idName from a frame to another frame. the text is an Id from an SQLite database. I have an Listview.ItemTemplate that define the item
<ListView.ItemTemplate>
<DataTemplate>
<Grid Height="Auto" Margin="0,5">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" VerticalAlignment="Top" Margin="12,0,0,0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<TextBlock x:Name="idName" Text="{Binding Id}" FontSize="12" VerticalAlignment="Center" Grid.Column="0" Margin="5,0,12,0"/>
<RelativePanel Grid.Column="1">
<TextBlock x:Name="titleBlock" Text="{Binding Title}" FontSize="25" HorizontalAlignment="Left" VerticalAlignment="Top"/>
<TextBlock x:Name="directorLabel" Text="REGISTA:" FontSize="20" RelativePanel.Below="titleBlock" FontWeight="Light"/>
<TextBlock x:Name="directorBlock" Text="{Binding Director}" FontSize="20" RelativePanel.Below="titleBlock" RelativePanel.RightOf="directorLabel"/>
<TextBlock x:Name="yearLabel" Text="ANNO:" FontSize="20" FontWeight="Light" RelativePanel.RightOf="directorBlock" Margin="12,0,0,0" RelativePanel.Below="titleBlock"/>
<TextBlock x:Name="yearBlock" Text="{Binding Year}" FontSize="20" RelativePanel.Below="titleBlock" RelativePanel.RightOf="yearLabel"/>
</RelativePanel>
</Grid>
</StackPanel>
</Grid>
</DataTemplate>
</ListView.ItemTemplate>
I use in the Code Behind this:
this.Frame.Navigate(typeof(FilmInfo), idName.Text);
but idName.Text is an ItemTemplate.
How can I do that?
I'm assuming the item must somehow be selected in the ListView in order to take action on it... if so, you can use the item directly.
YourClassName selectedFilm = YourListView.SelectedItem as YourClassName;
If(selectedFilm != null)
{
this.Frame.Navigate(typeof(FilmInfo), selectedFilm.Id);
}
UPDATE after comment
OK... if you're using the item click event, you can do the same thing...
private void ItemClickEvent(object sender, ItemClickEventArgs e)
{
YourClassName selectedFilm = e.ClickedItem as YourClassName;
if(selectedFilm != null)
{
this.Frame.Navigate(typeof(FilmInfo), selectedFilm.Id);
}
}

Related Links

Adding jQuery function from Serverside
Adding data-* attributes to a DevExpress MVC gridview cell
type of types in Java
Collision of two balls in wpf and getting the paths of colliding balls [closed]
Use external resources within an event handler
Issues with retargeting app for windows 8.1
How to extract an unknown amount of text from a file
How to use XMLReader to parse XML document? [closed]
How do you get the default binding mode of a dependency property?
Row filter crashes C# app with System.Data.EvaluateException was unhandled message
What is the correct way to get the iOS Library folder using Xamarin.iOS?
Building Portable Class Library Project in build server fails
Kinect front light cause grip detection errors
What is the difference between Sensors namespaces available for Windows Phone developers?
Xtrareports Bands Size and Location
SQL query to linq with right and left joins and nested query

Categories

HOME
asterisk
pact
network-programming
popover
bigtable
highmaps
data-modeling
x509certificate
coordinates
perl6
css-selectors
richtextbox
atlassian-fisheye
collision-detection
clip-path
software-collections
spring-data-solr
openbsd
apache-httpclient-4.x
solidity
watson-dialog
cakephp-2.0
logstash-configuration
tag-cloud
css-float
serenity-js
include-path
coccinelle
ecmascript-2017
aspxgridview
akavache
android-6.0-marshmallow
libxml2
jbossfuse
undo
directions
postgresql-9.6
webspeech-api
machine-code
dropdownbox
motherboard
lighting
blueimp
google-chrome-console
test-kitchen
web-technologies
text-extraction
grails-2.0
easyquery
react.rb
noise
recursive-query
therubyracer
qt3d
firebase-job-dispatcher
foreground
aws-kms
nd4j
factorization
ooad
angular-promise
eaaccessory
playn
photogrammetry
mergecursor
radgrid
applinks
fiware-health
jsonschema2pojo
powershell-v1.0
sigma-grid-control
xps
urlfetch
freeimage
custom-cursor
php-gettext
jmesa
scsf
log-shipping
opendir
qvariant
sipdroid
object-tag
excellibrary
browser-state

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App