locked
Windows 8 People app RRS feed

  • Question

  • In windows8 internal People app, when we add a new people, there's a plus button with 'Name', 'Email' and so on, when we click the button, there will be a new textbox appears for us to input a new type of 'Name', 'Email', and if the column has no space, it will automatically create a textbox in the next column, how to implement that? 

    Another question, there're many types of 'Name', 'Email' for us to choose, if one of the types has already exist, when we click the 'plus' button to create a new type of 'Name' or 'Email', the list of the types will remove the exist one, how to implement that?


    Go go Doraemon!

    Monday, December 17, 2012 12:01 PM

Answers

  • Hi,

    First one: I think the People app should use something like WrapGrid which can make items wrap if the screen can't put the item in one direction.

    For example:

    <GridView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid Orientation="Vertical" />
                    </ItemsPanelTemplate>
                </GridView.ItemsPanel>

    Second one:I think the replacing behavior should be done in code behind. You could create a ObservableCollection<T>(or a customized class which implement INotifyPropertyChanged interface or derived from BindableBase) and bind it to GridView. After adding the item, check the collection if there is any item with same type. Replace the item, the GridView will refresh automatically.

    Aaron
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Aaron Xue Monday, December 31, 2012 8:24 AM
    Wednesday, December 19, 2012 8:58 AM

All replies

  • the answer of the first question is that he use the gridview control
    check this link
    http://code.msdn.microsoft.com/windowsapps/ListViewSimple-d5fc27dd
    • Proposed as answer by Ahmed-Fouad Monday, December 17, 2012 11:30 PM
    • Unproposed as answer by Aaron Xue Wednesday, December 19, 2012 8:58 AM
    Monday, December 17, 2012 11:29 PM
  • Hi Ahmed0Fouad,

    Thanks for your reply, I know it uses gridview control, but how does it dynamically modify the gridview? After click 'plus' button, the layout is changed.


    Go go Doraemon!

    Tuesday, December 18, 2012 1:49 AM
  • Hi,

    First one: I think the People app should use something like WrapGrid which can make items wrap if the screen can't put the item in one direction.

    For example:

    <GridView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapGrid Orientation="Vertical" />
                    </ItemsPanelTemplate>
                </GridView.ItemsPanel>

    Second one:I think the replacing behavior should be done in code behind. You could create a ObservableCollection<T>(or a customized class which implement INotifyPropertyChanged interface or derived from BindableBase) and bind it to GridView. After adding the item, check the collection if there is any item with same type. Replace the item, the GridView will refresh automatically.

    Aaron
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Aaron Xue Monday, December 31, 2012 8:24 AM
    Wednesday, December 19, 2012 8:58 AM