Could use some XAML Help

Associate
Joined
18 Oct 2002
Posts
2,367
Really struggling with a bit of XAML at the moment. Trying to learn UWP dev and this is my first time in XAML. I have put up a post on Stack Overflow with some code and screenshots of what I'm trying to achieve - would really appreciate any people with XAML experience taking a look over it for me.

Thanks
 
Associate
OP
Joined
18 Oct 2002
Posts
2,367
I wasn't styling my ListView ItemContainerStyle which apparently you need to do :) My next task is to work out how to show different bits of XAML based on what's returned from a server. E.g. Green background if tram is running on time or red if late etc. Do you have any idea on that?

Thanks
 
Soldato
Joined
28 Oct 2006
Posts
12,456
Location
Sufferlandria
Maybe try something like:
<TextBlock Text="{Binding Destination}" x:key="{Binding ExpectedTime}"/>

And the styles:

<Style x:Key="OnTime" TargetType="TextBlock">
//green background
</style>
<Style x:Key="Late" TargetType="TextBlock">
//red background
</style>
 
Associate
OP
Joined
18 Oct 2002
Posts
2,367
How would I send the different key from the c#?

Edit: Oh I see I can sent binding on the key also - I will have a go and see what I come up with.
 
Back
Top Bottom