Click here to Skip to main content
15,512,747 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: How to bind textboxes text to the ViewModel Pin
Ashfaque Hussain30-Oct-13 3:23
Ashfaque Hussain30-Oct-13 3:23 
GeneralRe: How to bind textboxes text to the ViewModel Pin
David C# Hobbyist.30-Oct-13 5:47
professionalDavid C# Hobbyist.30-Oct-13 5:47 
GeneralRe: How to bind textboxes text to the ViewModel Pin
Ashfaque Hussain30-Oct-13 5:53
Ashfaque Hussain30-Oct-13 5:53 
GeneralRe: How to bind textboxes text to the ViewModel Pin
David C# Hobbyist.30-Oct-13 6:03
professionalDavid C# Hobbyist.30-Oct-13 6:03 
GeneralRe: How to bind textboxes text to the ViewModel Pin
Ashfaque Hussain30-Oct-13 8:55
Ashfaque Hussain30-Oct-13 8:55 
QuestionRe: How to bind textboxes text to the ViewModel Pin
Matt T Heffron30-Oct-13 12:07
professionalMatt T Heffron30-Oct-13 12:07 
AnswerRe: How to bind textboxes text to the ViewModel Pin
Ashfaque Hussain30-Oct-13 19:40
Ashfaque Hussain30-Oct-13 19:40 
GeneralRe: How to bind textboxes text to the ViewModel Pin
Matt T Heffron31-Oct-13 8:37
professionalMatt T Heffron31-Oct-13 8:37 
First you need to initialize MyViewModelList when the View Model is constructed.

C#
private const int NumberOfStrings = 3;  // use appropriate number (and better name), your code showed 3
public ViewModel()   // constructor
{
  MyViewModelList = new List<string>(NumberOfStrings);
  for (int i = 0; i < NumberOfStrings; ++i)
  {
    MyViewModelList[i] = string.Empty;
  }
}
public List<string> MyViewModelList { get; private set; }

At this point, the TextBoxes will be bound to the empty strings, and should update the corresponding entry in the MyViewModelList whenever they lose focus.
GeneralRe: How to bind textboxes text to the ViewModel Pin
Ashfaque Hussain31-Oct-13 9:09
Ashfaque Hussain31-Oct-13 9:09 
QuestionHow to import the row items of datagrid to the Stackpannel in MVVM Pin
Ashfaque Hussain29-Oct-13 0:20
Ashfaque Hussain29-Oct-13 0:20 
AnswerRe: How to import the row items of datagrid to the Stackpannel in MVVM Pin
Mycroft Holmes29-Oct-13 3:01
professionalMycroft Holmes29-Oct-13 3:01 
GeneralRe: How to import the row items of datagrid to the Stackpannel in MVVM Pin
Ashfaque Hussain29-Oct-13 5:27
Ashfaque Hussain29-Oct-13 5:27 
QuestionHow to change the content of Button in View from ViewModel Pin
Ashfaque Hussain28-Oct-13 1:05
Ashfaque Hussain28-Oct-13 1:05 
AnswerRe: How to change the content of Button in View from ViewModel Pin
Pete O'Hanlon28-Oct-13 1:13
mvaPete O'Hanlon28-Oct-13 1:13 
AnswerRe: How to change the content of Button in View from ViewModel Pin
Abhinav S28-Oct-13 1:51
Abhinav S28-Oct-13 1:51 
QuestionMouse Down event Pin
Ashfaque Hussain25-Oct-13 2:04
Ashfaque Hussain25-Oct-13 2:04 
AnswerRe: Mouse Down event Pin
Pete O'Hanlon25-Oct-13 2:32
mvaPete O'Hanlon25-Oct-13 2:32 
AnswerRe: Mouse Down event Pin
Abhinav S26-Oct-13 2:19
Abhinav S26-Oct-13 2:19 
GeneralRe: Mouse Down event Pin
Ashfaque Hussain26-Oct-13 8:44
Ashfaque Hussain26-Oct-13 8:44 
AnswerRe: Mouse Down event Pin
Abhinav S26-Oct-13 19:13
Abhinav S26-Oct-13 19:13 
AnswerRe: Mouse Down event Pin
_Maxxx_27-Oct-13 20:11
professional_Maxxx_27-Oct-13 20:11 
GeneralRe: Mouse Down event Pin
Mycroft Holmes27-Oct-13 20:21
professionalMycroft Holmes27-Oct-13 20:21 
GeneralRe: Mouse Down event Pin
_Maxxx_27-Oct-13 21:50
professional_Maxxx_27-Oct-13 21:50 
GeneralRe: Mouse Down event Pin
Pete O'Hanlon28-Oct-13 1:23
mvaPete O'Hanlon28-Oct-13 1:23 
AnswerRe: Mouse Down event Pin
Meshack Musundi27-Oct-13 21:16
professionalMeshack Musundi27-Oct-13 21:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.