Question

Is it possible to create a list of buttons that a user can choose and add to their own empty list? each button will then contain a specific navigation event handler?

Was it helpful?

Solution

Yes you can. You can create a ListView with a list of buttons binded to it. For example:

    <ListView x:Name="NavBttnList" ItemSource={Binding}>
        <ListView.ItemTemplate>
            <DataTemplate>
                <Button Command="{Binding Nav_MethodName }" Content="{Binding text}" />
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>

Set up the appropriate classes in the code behind for data binding. Visit: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh464965.aspx to see how data binding works.

OTHER TIPS

You can use the WrapGrid control to get a collection of buttons or anything else displayed.

http://msdn.microsoft.com/en-US/library/windows/apps/windows.ui.xaml.controls.wrapgrid

You can use a button or any other UI control for the item template.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top