0

So I want to add x buttons this value is going to be from a variable that is inputed by the user
I put like 5 tables and 5 buttons will appear.
Any help?

2
  • Read a good book? We cannot teach programming, that's way to broad for our format. Do you have a specific question, are you stuck at a specific problem that you tried to solve yourself first? Post your best try. Commented Apr 18, 2016 at 16:35
  • 2
    Take a look at stackoverflow.com/questions/5929710/… to see how to dynamically add buttons. ...possible duplicate. Commented Apr 18, 2016 at 16:35

1 Answer 1

1

Sounds like you want an ItemsControl. It let's you define a template (in your case, a button) and bind to a collection of items like this:

<ItemsControl ItemsSource={Binding MyCollectionOfObjects>
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <Button Content="{Binding MyStringProperty}"/>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.