Afrikaans
Akan
Albanian
Amharic
Arabic
Armenian
Azerbaijani
Basque
Belarusian
Bemba
Bengali
Bihari
Bosnian
Breton
Bulgarian
Cambodian
Catalan
Cebuano
Cherokee
Chichewa
Chinese (Simplified)
Chinese (Traditional)
Corsican
Croatian
Czech
Danish
Dutch
English
Esperanto
Estonian
Ewe
Faroese
Filipino
Finnish
French
Frisian
Ga
Galician
Georgian
German
Greek
Guarani
Gujarati
Haitian Creole
Hausa
Hawaiian
Hebrew
Hindi
Hmong
Hungarian
Icelandic
Igbo
Indonesian
Interlingua
Irish
Italian
Japanese
Javanese
Kannada
Kazakh
Kinyarwanda
Kirundi
Kongo
Korean
Krio (Sierra Leone)
Kurdish
Kurdish (Soranรฎ)
Kyrgyz
Laothian
Latin
Latvian
Lingala
Lithuanian
Lozi
Luganda
Luo
Luxembourgish
Macedonian
Malagasy
Malay
Malayalam
Maltese
Maori
Marathi
Mauritian Creole
Moldavian
Mongolian
Myanmar (Burmese)
Montenegrin
Nepali
Nigerian Pidgin
Northern Sotho
Norwegian
Norwegian (Nynorsk)
Occitan
Oriya
Oromo
Pashto
Persian
Polish
Portuguese (Brazil)
Portuguese (Portugal)
Punjabi
Quechua
Romanian
Romansh
Runyakitara
Russian
Samoan
Scots Gaelic
Serbian
Serbo-Croatian
Sesotho
Setswana
Seychellois Creole
Shona
Sindhi
Sinhalese
Slovak
Slovenian
Somali
Spanish
Spanish (Latin American)
Sundanese
Swahili
Swedish
Tajik
Tamil
Tatar
Telugu
Thai
Tigrinya
Tonga
Tshiluba
Tumbuka
Turkish
Turkmen
Twi
Uighur
Ukrainian
Urdu
Uzbek
Welsh
Wolof
Xhosa
Yiddish
Yoruba
Zulu
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.