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?

有帮助吗?

解决方案

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.

其他提示

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top