1 00:00:00,630 --> 00:00:01,510 ‫Welcome back. 2 00:00:01,530 --> 00:00:05,850 ‫In this video, we are going to create a list box. 3 00:00:05,850 --> 00:00:09,780 ‫And you can see here we have a little list box with the entries. 4 00:00:09,780 --> 00:00:15,450 ‫So we have Bayern Munich having three points or goals and then we have Real Madrid with two goals and 5 00:00:15,450 --> 00:00:17,330 ‫the match is almost over. 6 00:00:17,340 --> 00:00:21,690 ‫So we are using multiple different elements here, which we haven't used yet. 7 00:00:21,690 --> 00:00:29,070 ‫And when I select one and I click on this button show selected, a little message box pops up and tells 8 00:00:29,070 --> 00:00:33,630 ‫me about the selected box, and it gives me some further information, or at least in this case, it 9 00:00:33,630 --> 00:00:35,100 ‫just gives me this information. 10 00:00:35,100 --> 00:00:40,260 ‫And of course, you could add a little more information in here, so you could build a little application 11 00:00:40,260 --> 00:00:47,100 ‫from that which takes the data from the Internet and is updated all the time and well, simply shows 12 00:00:47,100 --> 00:00:49,530 ‫you the current score of the current matches. 13 00:00:50,070 --> 00:00:50,400 ‫All right. 14 00:00:50,400 --> 00:00:52,470 ‫Let's go ahead and start doing that. 15 00:00:52,470 --> 00:00:56,760 ‫So I'm going to create a new project for this, which I'm going to call list box. 16 00:00:56,760 --> 00:01:00,390 ‫So let's go ahead and have this name already. 17 00:01:00,390 --> 00:01:05,340 ‫So I'm going to call it C, and in here I'm going to mainly use XAML. 18 00:01:05,340 --> 00:01:07,830 ‫So I'm going to drag it all up. 19 00:01:08,400 --> 00:01:12,900 ‫And we have this well, our image here or a window here still. 20 00:01:12,900 --> 00:01:22,020 ‫But now what I want to do is I want to use grids again, but I'm going to use multiple rows, of course. 21 00:01:22,020 --> 00:01:28,170 ‫So let's go ahead and create a column definition, a row definition and those kind of things. 22 00:01:28,170 --> 00:01:33,840 ‫And by the way, we actually only need two columns, so it's not going to be that complicated. 23 00:01:33,840 --> 00:01:35,160 ‫So we only have two different columns. 24 00:01:35,160 --> 00:01:38,430 ‫We don't have multiple rows, so we won't need the row definition. 25 00:01:38,430 --> 00:01:43,500 ‫But for you, if you recall how to do that, that's always good to know. 26 00:01:43,500 --> 00:01:48,510 ‫So you need to column definitions first and then here you can define your columns. 27 00:01:48,510 --> 00:02:02,580 ‫And I'm going to go ahead and define a column with a width of star and a column definition with a width 28 00:02:02,670 --> 00:02:04,410 ‫of, let's say 100. 29 00:02:05,190 --> 00:02:09,120 ‫So I want to have a button, a second column, pretty much. 30 00:02:09,120 --> 00:02:10,920 ‫That's what I want to use here. 31 00:02:11,820 --> 00:02:12,450 ‫All right. 32 00:02:12,960 --> 00:02:15,240 ‫So these are the two columns that I have. 33 00:02:15,270 --> 00:02:20,340 ‫This one is going to contain the list box, and the right one will simply contain this huge button that 34 00:02:20,340 --> 00:02:24,480 ‫we can click once we want to get more information about a match. 35 00:02:24,480 --> 00:02:32,160 ‫So let's create a list box now and I'm going to use the list box keyword and this list box will get 36 00:02:32,160 --> 00:02:32,550 ‫a name. 37 00:02:32,550 --> 00:02:39,810 ‫I'm going to call this list box matches and I'm going to horizontally align the content. 38 00:02:39,810 --> 00:02:47,640 ‫So horizontal content alignment and I'm going to stretch it so that it stretches out the content of 39 00:02:47,640 --> 00:02:48,780 ‫my list box. 40 00:02:50,450 --> 00:02:54,110 ‫And this one here, this lbw match should be the name, by the way. 41 00:02:54,110 --> 00:02:58,010 ‫So name is ll be matches. 42 00:02:58,880 --> 00:03:05,090 ‫All right, next, I want a specific item template. 43 00:03:05,090 --> 00:03:09,080 ‫So a list box can have a item template. 44 00:03:09,350 --> 00:03:15,290 ‫So I'm going to use list box dot item template. 45 00:03:15,500 --> 00:03:18,260 ‫And in there I can have a data template. 46 00:03:18,260 --> 00:03:26,840 ‫So I'm going to create a new data template and now I can finally go ahead and add the text blocks or 47 00:03:26,840 --> 00:03:27,890 ‫the information. 48 00:03:27,890 --> 00:03:33,440 ‫So as you can see, it's structured in a way that we haven't seen yet, but that's totally fine. 49 00:03:33,470 --> 00:03:35,930 ‫You will see how it works in a second. 50 00:03:35,930 --> 00:03:39,890 ‫So we have this list box, then we have the item template, then the data template. 51 00:03:39,890 --> 00:03:44,300 ‫And in here we can display the data and I'm going to use a grid here. 52 00:03:44,300 --> 00:03:50,450 ‫So I'm going to use a grid with margins of two. 53 00:03:51,020 --> 00:03:56,720 ‫And this grid needs column definitions as well. 54 00:03:56,720 --> 00:04:04,880 ‫So I'm going to create a new grid dot column definitions tag. 55 00:04:04,880 --> 00:04:11,780 ‫And then here I'm going to define the column definitions or create the column definitions. 56 00:04:11,780 --> 00:04:15,050 ‫And by the way, I'm going to keep it simple here as well. 57 00:04:15,050 --> 00:04:23,810 ‫And what I want to have is simply a width, which is going to take the same space as all the other columns. 58 00:04:24,170 --> 00:04:26,930 ‫So I will have five columns here. 59 00:04:27,230 --> 00:04:32,710 ‫One is going to be the team one, the second one is going to be the score. 60 00:04:32,750 --> 00:04:34,940 ‫Third one is score again. 61 00:04:35,030 --> 00:04:38,450 ‫Fourth one is the team or the second team. 62 00:04:38,450 --> 00:04:41,120 ‫And then finally we have the progress. 63 00:04:41,120 --> 00:04:46,040 ‫So we want to know how far in the game already is or the match is. 64 00:04:46,280 --> 00:04:50,180 ‫And now I want to have multiple text blocks. 65 00:04:50,180 --> 00:05:03,710 ‫So one is going to be a text block with a grid dot column position of zero and a text that I want to 66 00:05:03,710 --> 00:05:04,430 ‫bind. 67 00:05:04,790 --> 00:05:08,750 ‫So I'm going to bind this text to team one. 68 00:05:09,350 --> 00:05:11,660 ‫Now, you might wonder, what is team one? 69 00:05:11,660 --> 00:05:16,280 ‫Well, we need to define this team one in our code behind. 70 00:05:17,420 --> 00:05:18,050 ‫All right. 71 00:05:18,050 --> 00:05:23,870 ‫So what I'm going to do is, before I go any further here with example, I'm going to go ahead into 72 00:05:23,870 --> 00:05:29,330 ‫the code behind, and I'm going to create a new class which is going to take care of matches. 73 00:05:30,350 --> 00:05:37,340 ‫So this is just going to be a very simple class, public class match. 74 00:05:37,460 --> 00:05:44,840 ‫And this class will only contain properties so public and actually let's create a property here. 75 00:05:44,840 --> 00:05:55,940 ‫So like this is going to be easier prop and score one, then another one, score two, then I need one, 76 00:05:55,940 --> 00:06:05,600 ‫which is going to be a string, which is going to be two one and then another one, which is also a 77 00:06:05,600 --> 00:06:09,920 ‫string, and this one will be team two. 78 00:06:10,370 --> 00:06:15,020 ‫And now finally I have one which is also an integer, which will be the completion. 79 00:06:15,020 --> 00:06:20,840 ‫So I want to know how far in the game is or how many minutes of the total match have passed. 80 00:06:21,050 --> 00:06:25,490 ‫So these are the general information about this match class. 81 00:06:25,490 --> 00:06:30,620 ‫And you see this class is amazing and generally object oriented programming is going to be amazing in 82 00:06:30,620 --> 00:06:36,800 ‫here because we simply can adjust that if we want to add some more information. 83 00:06:36,800 --> 00:06:44,840 ‫For example, we want to add the players who are on the field and we could create a whole new property 84 00:06:44,840 --> 00:06:46,550 ‫which is going to take care of the players. 85 00:06:46,550 --> 00:06:51,620 ‫So we could create a class which is going to be used within match, which is going to contain all the 86 00:06:51,620 --> 00:06:54,050 ‫different player names or something like that. 87 00:06:54,050 --> 00:06:58,940 ‫So that's great for extensibility, so you can easily maintain that code. 88 00:06:59,330 --> 00:07:07,160 ‫Now we have this match class and within my main window I want to go ahead and create a list of matches. 89 00:07:07,160 --> 00:07:14,420 ‫So I'm going to create a list and I'm going to call it match or actually I'm going to use Match as the 90 00:07:14,420 --> 00:07:16,700 ‫list element that I want to be in there. 91 00:07:16,700 --> 00:07:21,980 ‫And it's going to be called matches, which is going to be a new list of matches. 92 00:07:25,010 --> 00:07:25,340 ‫All right. 93 00:07:25,340 --> 00:07:29,930 ‫So now I have this match matches list and I can add elements to that list. 94 00:07:29,930 --> 00:07:42,560 ‫So I'm going to add a new match, which is going to be my team one with the value of Bayern Munich. 95 00:07:42,590 --> 00:07:48,530 ‫I'm a big Bayern fan in Germany and then the best that the best team in Germany and there. 96 00:07:49,710 --> 00:07:51,060 ‫Very good internationally. 97 00:07:51,150 --> 00:07:55,050 ‫Hopefully they win the Champions League this year. 98 00:07:55,890 --> 00:07:56,880 ‫Still looking good. 99 00:07:56,880 --> 00:07:58,810 ‫They just beat Sevilla. 100 00:07:58,830 --> 00:08:00,330 ‫Sorry for the severe fans. 101 00:08:00,540 --> 00:08:07,350 ‫Then we have the score one, which I'm going to set as three and the score two, which I'm going to 102 00:08:07,350 --> 00:08:08,730 ‫set at two. 103 00:08:08,940 --> 00:08:15,860 ‫And then finally we have a completion, which I'm going to set at something like 85. 104 00:08:15,870 --> 00:08:22,260 ‫So the match is almost over and Bayern is one point ahead or one goal ahead. 105 00:08:23,940 --> 00:08:27,200 ‫So that's generally how I can create a new match. 106 00:08:27,210 --> 00:08:33,090 ‫And you see, we didn't need to create a constructor, we didn't need to create any methods in that 107 00:08:33,090 --> 00:08:33,510 ‫class. 108 00:08:33,510 --> 00:08:39,900 ‫We simply created a very basic class which has properties and we assign those properties in here and 109 00:08:39,900 --> 00:08:42,240 ‫now we have an object with all of those properties. 110 00:08:42,240 --> 00:08:50,340 ‫And that's great because now we can use that in order to show it onto our list here or actually onto 111 00:08:50,340 --> 00:08:50,970 ‫our. 112 00:08:51,840 --> 00:08:52,810 ‫List box. 113 00:08:53,560 --> 00:08:57,870 ‫So I have this first text block, which is going to be theme one. 114 00:08:57,880 --> 00:09:03,190 ‫Then I have the second text block, which should be connected to the score of Team One. 115 00:09:03,190 --> 00:09:04,810 ‫So it's going to be score one. 116 00:09:05,530 --> 00:09:10,930 ‫Then the next text block should be information about team two. 117 00:09:11,140 --> 00:09:13,690 ‫So this is going to be team two. 118 00:09:14,440 --> 00:09:19,180 ‫And by information about team two is just the name of Team two and then finally score two. 119 00:09:19,510 --> 00:09:28,930 ‫And very finally so last I want to have a well have to want to have a progress bar actually not a text 120 00:09:28,930 --> 00:09:33,880 ‫block which will inform me about how far in the game is. 121 00:09:33,880 --> 00:09:41,080 ‫So a progress bar which I'm going to set at Grid Column four. 122 00:09:41,710 --> 00:09:44,650 ‫And we will need to change the columns here as well, of course. 123 00:09:44,650 --> 00:09:47,020 ‫One, two, three, four. 124 00:09:47,050 --> 00:09:49,780 ‫So we have these five columns that we have set up here. 125 00:09:49,780 --> 00:09:57,730 ‫And now I'm going to set the team one at column zero, score of team one in column one and so forth. 126 00:09:59,210 --> 00:10:07,010 ‫And now I want to have a minimum value for that progress bar, which is going to be zero and a maximum 127 00:10:07,010 --> 00:10:07,930 ‫value. 128 00:10:07,940 --> 00:10:13,430 ‫And if you know about soccer, then you know that it's 90 minutes or football based on where you're 129 00:10:13,430 --> 00:10:18,530 ‫from or which English you want to use British English or American English. 130 00:10:19,070 --> 00:10:27,020 ‫So we have a value that we want to bind, and we did that with this text here, so we simply bound to 131 00:10:27,020 --> 00:10:27,380 ‫text. 132 00:10:27,380 --> 00:10:33,740 ‫But now we want to bind the value of a progress bar, because a progress bar is not just a text, it's 133 00:10:33,740 --> 00:10:37,390 ‫actually well, it needs an integer type of value. 134 00:10:37,400 --> 00:10:47,000 ‫So what I'm going to bind here is going to be the completion completion, and now we should be able 135 00:10:47,000 --> 00:10:47,960 ‫to test that. 136 00:10:47,960 --> 00:10:51,950 ‫So even though it's complaining, that's because I'm not closing the progress bar. 137 00:10:52,310 --> 00:10:52,790 ‫All right. 138 00:10:52,790 --> 00:10:57,620 ‫But as you see, there is nothing here because the values that we are using, they are in code. 139 00:10:57,620 --> 00:11:00,200 ‫And well, it doesn't compile the code yet. 140 00:11:00,200 --> 00:11:04,550 ‫It doesn't check the code of our main class here of our example file. 141 00:11:05,060 --> 00:11:07,700 ‫And now let me check if we can run it. 142 00:11:08,930 --> 00:11:16,280 ‫And by the way, if we want to run it, there's one important thing to add and that's lab matches. 143 00:11:16,280 --> 00:11:21,950 ‫Dot item source is equal to our matches. 144 00:11:22,580 --> 00:11:25,820 ‫Now what is LWB matches and what is the item source? 145 00:11:25,820 --> 00:11:31,430 ‫Well, if we look at all the matches, that is our list box. 146 00:11:31,790 --> 00:11:35,780 ‫So I call this list box, I'll be standing for list box matches. 147 00:11:35,780 --> 00:11:40,430 ‫So this list box is going to take care of all our matches or it's going to display all of our matches. 148 00:11:40,430 --> 00:11:41,420 ‫That's the idea behind it. 149 00:11:41,420 --> 00:11:41,930 ‫Right. 150 00:11:41,930 --> 00:11:46,400 ‫And it needs a data source because otherwise it won't show any data. 151 00:11:46,400 --> 00:11:50,930 ‫And I just said, okay, I want it to be the data source of our matches. 152 00:11:51,410 --> 00:11:54,350 ‫And well, the matches should be the data source. 153 00:11:54,350 --> 00:12:00,470 ‫So now it should show this one match which is Bayern Munich versus Real Madrid with 3 to 2 score. 154 00:12:01,130 --> 00:12:06,350 ‫And then we are Bayern Munich, Real Madrid, Bayern is three goals, real has two goals. 155 00:12:06,350 --> 00:12:11,780 ‫And then we have the Progress Bar which says Time's almost up, so the match is almost over. 156 00:12:11,810 --> 00:12:12,590 ‫Now. 157 00:12:12,890 --> 00:12:21,860 ‫I wanted to have the score in the middle of the two teams, so I will need to change the order here. 158 00:12:24,120 --> 00:12:26,100 ‫And I'm going to change it like this. 159 00:12:26,700 --> 00:12:32,550 ‫Of course, I need to adjust the columns here as well because I would like to have the scores just next 160 00:12:32,550 --> 00:12:33,030 ‫to each other. 161 00:12:33,030 --> 00:12:35,040 ‫It's easier to compare them. 162 00:12:36,000 --> 00:12:43,470 ‫So let's run it again and we can see minus three and the Real Madrid has two and they should actually 163 00:12:43,470 --> 00:12:46,800 ‫be a little well, the text should be centered. 164 00:12:46,800 --> 00:12:56,610 ‫So what we can do here is actually make it a little nicer for the score and I'm going to align it and 165 00:12:56,610 --> 00:13:02,370 ‫I can do that with a line that will be horizontal alignment center. 166 00:13:03,360 --> 00:13:08,460 ‫I'm going to do that for both the scores. 167 00:13:09,330 --> 00:13:10,560 ‫So let's run it again. 168 00:13:10,950 --> 00:13:16,260 ‫As you can see now, this is how you can then adjust your user interface and apply your changes and 169 00:13:16,260 --> 00:13:17,700 ‫make it a little nicer. 170 00:13:17,700 --> 00:13:24,120 ‫What you could even do is align this number towards the right and that number towards the left, and 171 00:13:24,120 --> 00:13:28,500 ‫you could even enter something like a colon in between or something like that. 172 00:13:29,010 --> 00:13:29,670 ‫All right. 173 00:13:29,790 --> 00:13:31,200 ‫So that's our first match. 174 00:13:31,200 --> 00:13:33,030 ‫Now for you, a little challenge. 175 00:13:33,030 --> 00:13:36,300 ‫Please go ahead and add multiple different matches. 176 00:13:36,300 --> 00:13:37,500 ‫And it doesn't have to be soccer. 177 00:13:37,500 --> 00:13:42,690 ‫You can or football you can enter matches of whatever the progress bar should be, something like the 178 00:13:42,690 --> 00:13:48,660 ‫time that is up and you have simply the two teams with their scores on each side. 179 00:13:48,660 --> 00:13:50,220 ‫So please go ahead and add that. 180 00:13:53,590 --> 00:13:54,130 ‫All right. 181 00:13:54,370 --> 00:13:55,510 ‫I hope you tried it. 182 00:13:55,870 --> 00:14:00,460 ‫And it should be pretty straightforward because we have created this match here. 183 00:14:00,460 --> 00:14:06,670 ‫And the only thing that we need to do is to copy and paste that multiple times and now simply adjust 184 00:14:06,670 --> 00:14:08,880 ‫the team names and the scores. 185 00:14:08,890 --> 00:14:15,520 ‫So I had something prepared here and as I said, I'm a more of a football fan, so I'm going to add 186 00:14:15,520 --> 00:14:16,390 ‫football teams. 187 00:14:16,390 --> 00:14:23,590 ‫International one PSG standing for Paris Saint-Germain, that's going to be against Barsa and Barsa 188 00:14:23,590 --> 00:14:29,200 ‫is currently losing against Page, but they can still win it as they still have plenty of time. 189 00:14:29,200 --> 00:14:31,150 ‫So it's just the 55th minute. 190 00:14:31,990 --> 00:14:42,910 ‫Then we have Bvb be Dortmund, which is the second best team in Germany most of the time, and they 191 00:14:42,910 --> 00:14:46,030 ‫play against us or Roma. 192 00:14:47,260 --> 00:14:51,520 ‫Then we have another team here which is Manchester United. 193 00:14:52,210 --> 00:15:01,150 ‫They play against a galaxy pretty unlikely, but it can happen that they play against each other and 194 00:15:01,150 --> 00:15:06,910 ‫I'm going to get rid of the last score just so I don't have to type or to think about the different 195 00:15:06,910 --> 00:15:07,930 ‫team here as well. 196 00:15:07,930 --> 00:15:12,580 ‫So this match is not that long and or it hasn't passed that long. 197 00:15:12,580 --> 00:15:20,020 ‫And here Manchester United have scored one goal and Zlatan Ibrahimovic has also scored one goal for 198 00:15:20,020 --> 00:15:21,100 ‫LA Galaxy. 199 00:15:21,340 --> 00:15:25,370 ‫So that's the 35th minute and Barsa. 200 00:15:25,420 --> 00:15:27,640 ‫Well, I think that is all good. 201 00:15:27,640 --> 00:15:31,120 ‫So we can keep it as is and now we can run it again. 202 00:15:31,390 --> 00:15:37,540 ‫Then you will see that we have this little interface here showing us all the different teams and their 203 00:15:37,540 --> 00:15:41,470 ‫score, and then you can also see how long in they are. 204 00:15:41,710 --> 00:15:47,620 ‫Of course, you could add something like starting time, ending time, you could add all kinds of information, 205 00:15:47,620 --> 00:15:48,880 ‫whatever you can think of. 206 00:15:48,880 --> 00:15:52,990 ‫What would be pretty nice is if you had something like all the players. 207 00:15:52,990 --> 00:16:01,150 ‫So if you want to add the line up in here, what you could do is of course create a new property called 208 00:16:01,150 --> 00:16:09,040 ‫Line Up, which will just be a long maybe array of strings or even a list of strings containing all 209 00:16:09,040 --> 00:16:10,930 ‫the different player names. 210 00:16:10,930 --> 00:16:16,930 ‫And then you could display that once somebody presses on one of those and press the select button. 211 00:16:16,930 --> 00:16:21,130 ‫But we don't have the select button yet, and that's what we're going to add now, because you might 212 00:16:21,130 --> 00:16:24,430 ‫say, Oh, I want to have some additional information there. 213 00:16:24,430 --> 00:16:25,720 ‫And that's very relevant. 214 00:16:25,720 --> 00:16:30,100 ‫It's a really good if you want that or well, if you ever come to the point where you actually will 215 00:16:30,100 --> 00:16:31,600 ‫need that in an application. 216 00:16:31,600 --> 00:16:34,870 ‫So I'm going to put that outside of the list box. 217 00:16:35,200 --> 00:16:45,640 ‫And by the way, our list box, I didn't set up any column in here, but that's something that, well, 218 00:16:46,210 --> 00:16:47,470 ‫WPF does for us. 219 00:16:47,470 --> 00:16:52,450 ‫So the first element is going to be automatically at zero zero if we don't assign it. 220 00:16:52,570 --> 00:16:54,880 ‫But I'm going to assign it in a second. 221 00:16:54,880 --> 00:16:56,950 ‫First of all, I'm going to add a button, though. 222 00:16:57,310 --> 00:16:58,990 ‫So let's create a new button. 223 00:16:58,990 --> 00:17:06,370 ‫Let's set it at Grid Column one and let's add a click event to it. 224 00:17:06,370 --> 00:17:08,380 ‫And I'm going to create a new event. 225 00:17:08,380 --> 00:17:14,470 ‫So I'm going to just going to say new event handler and it's going to add a button click method for 226 00:17:14,470 --> 00:17:20,290 ‫me and I'm going to call this show selected. 227 00:17:24,280 --> 00:17:29,650 ‫So button click, maybe that's not the best name, but yeah, it's okay, we can use this button click. 228 00:17:29,650 --> 00:17:31,600 ‫So here we have this button click method. 229 00:17:31,600 --> 00:17:36,580 ‫And what that will do is it will show me some more information. 230 00:17:36,580 --> 00:17:39,130 ‫And for now it's just going to do the following. 231 00:17:39,340 --> 00:17:44,320 ‫It's just going to check if the match that was selected is not empty. 232 00:17:44,320 --> 00:17:53,200 ‫So lbe matches the selected item is not equal, empty or null. 233 00:17:54,100 --> 00:17:56,740 ‫Because if it's null then I don't want anything to happen. 234 00:17:56,740 --> 00:18:03,070 ‫But if it's not null, I want to show something in the message box and I'm going to show something like 235 00:18:03,070 --> 00:18:13,750 ‫Selected Match is going to be plus and in here I'm going to show all the different matches. 236 00:18:13,960 --> 00:18:14,740 ‫So. 237 00:18:15,740 --> 00:18:30,470 ‫I need something like El B matches that selected item as a match and from that I want to have the team 238 00:18:30,470 --> 00:18:37,640 ‫because now the matches selected item is not a match class, but I want to use it as a match. 239 00:18:38,090 --> 00:18:47,120 ‫And there I want to show team one plus an empty space, plus the next row. 240 00:18:48,110 --> 00:18:51,630 ‫So I'm going to copy this here. 241 00:18:51,680 --> 00:18:54,470 ‫I'm going to put it into the next line. 242 00:18:54,470 --> 00:18:56,270 ‫And here I don't want to show the team. 243 00:18:56,270 --> 00:18:58,040 ‫I want to show the score one. 244 00:19:00,470 --> 00:19:03,860 ‫Then in the next line, I want to show the score two. 245 00:19:05,510 --> 00:19:08,690 ‫And finally, I want to show the team two. 246 00:19:09,650 --> 00:19:19,130 ‫And afterwards, I don't need empty spaces anymore and I can use the colon and actually like this, 247 00:19:19,130 --> 00:19:20,180 ‫the semicolon. 248 00:19:21,200 --> 00:19:24,710 ‫So that's how I can show something on the message box. 249 00:19:24,710 --> 00:19:28,520 ‫And in this case, I'm going to show my team, by the way, once again. 250 00:19:28,520 --> 00:19:31,580 ‫So you see LWB matches selected item. 251 00:19:32,420 --> 00:19:39,710 ‫The selected item is an object and I want to use it as a match so that I can access its team one, team 252 00:19:39,740 --> 00:19:41,720 ‫two and score properties. 253 00:19:41,720 --> 00:19:42,950 ‫Otherwise I couldn't do that. 254 00:19:42,950 --> 00:19:46,820 ‫So if I leave that out, I cannot just call team one. 255 00:19:47,570 --> 00:19:48,800 ‫I'm going to show you in a second. 256 00:19:48,800 --> 00:19:56,390 ‫So here let's say I have this ll be matches dot selected item dot and here you can see it doesn't offer 257 00:19:56,390 --> 00:19:58,850 ‫me the properties because this is an object. 258 00:19:58,940 --> 00:20:05,450 ‫This selected item is just an object and it only has those method methods available equals to string 259 00:20:05,450 --> 00:20:06,170 ‫and so on. 260 00:20:06,260 --> 00:20:12,080 ‫But what I actually need is the properties of on my match and I know that the object that was selected 261 00:20:12,080 --> 00:20:15,410 ‫is a match object. 262 00:20:15,950 --> 00:20:18,380 ‫That's why I can access its properties. 263 00:20:19,100 --> 00:20:19,670 ‫Great. 264 00:20:19,670 --> 00:20:21,620 ‫So now let's go ahead and test that. 265 00:20:21,620 --> 00:20:24,830 ‫And after that we'll be done with this video. 266 00:20:24,830 --> 00:20:28,730 ‫So I hope you could follow along and it's all good. 267 00:20:28,730 --> 00:20:36,860 ‫So now I've selected Barsa or which is Barsa show selected and as you can see, selected match PSG three 268 00:20:36,860 --> 00:20:38,060 ‫to Barsa. 269 00:20:38,060 --> 00:20:39,980 ‫So this is the current score. 270 00:20:39,980 --> 00:20:45,470 ‫And here you could of course go ahead and add some more information or you could even open up a new 271 00:20:45,470 --> 00:20:51,740 ‫window in which you show all the different information, like the lineup of the match of the two teams 272 00:20:51,740 --> 00:20:52,700 ‫and so forth. 273 00:20:53,810 --> 00:20:58,700 ‫All right, that was quite a long video and we did quite some stuff. 274 00:20:58,700 --> 00:21:00,920 ‫We used list boxes. 275 00:21:00,920 --> 00:21:01,760 ‫You saw that. 276 00:21:02,090 --> 00:21:03,710 ‫Then we use the grid again. 277 00:21:03,710 --> 00:21:05,570 ‫Well, we see now to use that already. 278 00:21:05,570 --> 00:21:13,820 ‫But what was interesting in this one was, for one, that we have created a class which is just containing 279 00:21:13,820 --> 00:21:19,610 ‫properties which we used in order to create this little match list, which is pretty cool because we 280 00:21:19,610 --> 00:21:22,010 ‫can easily extend that as we go. 281 00:21:22,950 --> 00:21:31,740 ‫And we also used data binding and here so we bound to a property within our class without our main window 282 00:21:31,740 --> 00:21:34,860 ‫class which is our. 283 00:21:35,700 --> 00:21:40,530 ‫Match here, so we can easily access that and that's pretty cool. 284 00:21:41,130 --> 00:21:41,760 ‫Okeydokey. 285 00:21:41,760 --> 00:21:44,160 ‫So I'd say that's good for this video. 286 00:21:44,190 --> 00:21:45,360 ‫See you in the next one.