Answer the question
In order to leave comments, you need to log in
How to add data from textbox to collection?
Good day, there is a collection of type ObservableCollection PhonesCollection;
Phone - a class analogous to a table in a database
How to add data from a textbox to a collection?
Answer the question
In order to leave comments, you need to log in
The first method (in alphabetical order) of ObservableCollection is Add.
Actually this addition.
And textbox.Text is a string, which is probably one of the "bricks" of the class, the elements of which make up the collection.
That is, skipping models, view models, and the like. somewhere in the bowels there will be, for example, something
PhonesCollection.Add(
new PhonesCollectionElement(){
... a bunch of initializations, including the field=textbox.Text
}
)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question