All language subtitles for 6. How XAML to C# Linking Works

af Afrikaans
ak Akan
sq Albanian
am Amharic
ar Arabic
hy Armenian
az Azerbaijani
eu Basque
be Belarusian
bem Bemba
bn Bengali
bh Bihari
bs Bosnian
br Breton
bg Bulgarian
km Cambodian
ca Catalan
ceb Cebuano
chr Cherokee
ny Chichewa
zh-CN Chinese (Simplified)
zh-TW Chinese (Traditional)
co Corsican
hr Croatian
cs Czech
da Danish
nl Dutch
en English
eo Esperanto
et Estonian
ee Ewe
fo Faroese
tl Filipino
fi Finnish
fr French
fy Frisian
gaa Ga
gl Galician
ka Georgian
de German
el Greek
gn Guarani
gu Gujarati
ht Haitian Creole
ha Hausa
haw Hawaiian
iw Hebrew
hi Hindi
hmn Hmong
hu Hungarian
is Icelandic
ig Igbo
id Indonesian
ia Interlingua
ga Irish
it Italian
ja Japanese
jw Javanese
kn Kannada
kk Kazakh
rw Kinyarwanda
rn Kirundi
kg Kongo
ko Korean
kri Krio (Sierra Leone)
ku Kurdish
ckb Kurdish (Soranรฎ)
ky Kyrgyz
lo Laothian
la Latin
lv Latvian
ln Lingala
lt Lithuanian
loz Lozi
lg Luganda
ach Luo
lb Luxembourgish
mk Macedonian
mg Malagasy
ms Malay
ml Malayalam
mt Maltese
mi Maori
mr Marathi
mfe Mauritian Creole
mo Moldavian
mn Mongolian
my Myanmar (Burmese)
sr-ME Montenegrin
ne Nepali
pcm Nigerian Pidgin
nso Northern Sotho
no Norwegian
nn Norwegian (Nynorsk)
oc Occitan
or Oriya
om Oromo
ps Pashto
fa Persian
pl Polish
pt-BR Portuguese (Brazil)
pt Portuguese (Portugal)
pa Punjabi
qu Quechua
ro Romanian
rm Romansh
nyn Runyakitara
ru Russian
sm Samoan
gd Scots Gaelic
sr Serbian
sh Serbo-Croatian
st Sesotho
tn Setswana
crs Seychellois Creole
sn Shona
sd Sindhi
si Sinhalese
sk Slovak
sl Slovenian
so Somali
es Spanish
es-419 Spanish (Latin American)
su Sundanese
sw Swahili
sv Swedish
tg Tajik
ta Tamil
tt Tatar
te Telugu
th Thai
ti Tigrinya
to Tonga
lua Tshiluba
tum Tumbuka
tr Turkish
tk Turkmen
tw Twi
ug Uighur
uk Ukrainian
ur Urdu
uz Uzbek
cy Welsh
wo Wolof
xh Xhosa
yi Yiddish
yo Yoruba
zu Zulu

Original subtitles

So we have linked an element that we defined in some old bag to the same old see C-s file.

We were able to access these resoled label and assign a new value to ensconce and property.

But we may not understand exactly how this happens because this is not just some magical thing that

happens when you define an element instead of some.

There is some code actually happening for these to be available directly from the C-sharp file.

So what is exactly going on here has a lot to do with partial classes.

It turns out that one C-Sharp you are able to define partial definitions of certain elements.

For example classes are methods.

This means that a single class or a single method could be defined even in more than one file.

And that is exactly what is going on with our main window class.

Notice that precisely it is marked as partial.

It is a public class and don't worry if you don't fully understand what it was and how you say it how

to define it.

We are going to learn that in the coming sections.

What I want to focus on is the fact that this is partial meaning that a single class can be defined

in different files.

So our main window class is being defined in more than one file.

And if you get back to a C sharp file inside of the window definition you'll see how the class is being

set up.

We see these definition of a class and we are seeing the calculator dot main window which refers precisely

to these class Node is that it is in say the namespace calculator and that is called main window that

is the reason why it is the finest calculator the main window.

Now here in the Sammul file we are not precisely the finding the other part of the class what is going

on is that Visual Studio is automatically generating a file and in that file that by the way is another

C-Sharp file defining any elements that we may be defining right here instead of some.

So where is this file.

Well we'll we'll actually have to search it up a bit.

Gus Edis a little bit Hedon so you will have to navigate over here to your solution explorer and select

the button to the top that says show all files and once you are selected you will see two new folders

instead of your project that are by default hidden.

So we don't have by default access to them.

Would you then open or expand the OBD folder then in the debug folder and inside you will be able to

find a bunch of water generated files including some that are called main window.

These again are files generated by Visual Studio.

The one that I wanted to focus on is the main window that the I don't see as you mentioned.

These are fine.

And as you can see it is smart as all generated.

He says that this code was rated by at all and the changes in this file may cause incorrect behavior.

So do not change anything unless you absolutely know what you're doing but the only thing that I want

you to notice here is that if you go down these steal the calculator namespace just like we see on the

other C-charge file and it easy steal the partial class mail window.

So as you can see both are defined as public partial class main window.

So both are defining the exact same class.

And right below this definition we see some auto generated code that is label and that is resoled label.

And these easy element that with the find in Sammul a label called withholder label.

So these origin their rated code easy ones and makes it possible for us to access these element directly

from the C-sharp file and of course access its properties and assign new values et cetera.

So this was just a very brief lecture so you will understand a little bit about what is going on because

this is not just some magic that is happening.

There is actual code that makes the relationship between the salmon 1c share files possible.

Basically some order generated code that is defining another other part of the same class is creating

these elements and of course because these elements are in the same class they are accessible from both

parts of the class definition.

Hopefully now you see a bit more clear what is going on here and how the relationship works.

Now in the next lecture we're going to introduce another way of communication between several and sharp

that he's even hander's are going to respond to events that happen instead of the UI.

For example the press of a button and executes some code in response.

Can't find what you're looking for?
Get subtitles in any language from opensubtitles.com, and translate them here.