Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WPF WinRT
Hello Smile | :)
 
I hope you can help me out again.
 
So I´m about to writing a WinRT App with C# and XAML.
Let me make an example what it should doing:
 
We see 3 Labels, 3 Textboxes and a Addbutton:
Name | Surname | Birthday
TB1 | TB2 | TB3 | Addbutton
 
Now I type in my Informations as usally. By Clicking the Addbutton the App should take the given informations, append a new line to the Grid and write the given informations in it.
 
I get really stucked here...could any one please give me advises how to realise it?!
 
thanks a lot!
Posted 11-Feb-13 1:06am

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Alex - the approach I would take would be to use an ObservableCollection that holds a collection of the class you are using to wrap the name, surname and birthday in. This collection will be the ItemsSource in your GridView - when you add an item to it, the application will automatically display the new element.
  Permalink  
Comments
Alex Großmann at 11-Feb-13 8:49am
   
Thank you a lot Pete. This sounds very complicated....So I have to create a class with a lot of getters and setters?
Pete O'Hanlon at 11-Feb-13 8:53am
   
It's not complicated at all - it's something called MVVM. Have a read of this article to get an idea: http://msdn.microsoft.com/en-us/magazine/dd419663.aspx
Alex Großmann at 12-Feb-13 15:25pm
   
It worked! Thank you so much :-)
Pete O'Hanlon at 12-Feb-13 15:26pm
   
You're welcome Alex. I'm glad to have been able to help.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web03 | 2.8.140709.1 | Last Updated 11 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid