ListView.ItemTemplate> <DataTemplate x:DataType="local:studentItem"> <Grid> <StackPanel x:Name="stacklist" > <TextBlock x:Name="statuslist" Grid.Column="2" text="default" FontSize="14" FontWeight="SemiBold" Foreground="gray" Height="auto" HorizontalAlignment="Left" Width="200" Margin="0,20,0,0" DataContextChanged="statuslist_DataContextChanged" > <InlineUIContainer> <Image x:Name="statusimage" Source="Assets/searchtraineee.png" /> </InlineUIContainer> </TextBlock> </Grid> </DataTemplate> </ListView.ItemTemplate>
void Loadstudent() { List<studentItem> studentlist = DataAccess.Getstudents(studentCourseList); BitmapImage One = new BitmapImage(new Uri("ms-appx:///Assets/image1.png")); BitmapImage Two = new BitmapImage(new Uri("ms-appx:///Assets/image2.png" )); foreach (studentItem tplan in studentlist) { if (tplan.ProcStatus == 1) { statuslist.text = "completed"; statusimage.Source = One; } if (tplan.ProcStatus == 2) { statuslist.text = "notcompleted"; statusimage.Source = Two; } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)