Windows phone 7 在代码wp7中动态创建自定义按钮

Windows phone 7 在代码wp7中动态创建自定义按钮,windows-phone-7,Windows Phone 7,我有一个按钮控件,代码为 Button> <Button.Content> <StackPanel Orientation='Horizontal' > <TextBlock Text='{Binding ramDay, Mode=TwoWay}' Margin='0,-18,0,0' Style='{StaticResou

我有一个按钮控件,代码为

Button>
                <Button.Content>

                        <StackPanel Orientation='Horizontal' >
                            <TextBlock Text='{Binding ramDay, Mode=TwoWay}' Margin='0,-18,0,0' Style='{StaticResource PhoneTextTitle1Style}'/>
                        <TextBlock Text='{Binding enDay, Mode=TwoWay}' Margin='15,10,0,0' Style='{StaticResource PhoneTextTitle2Style}'/>

                    </StackPanel>

                </Button.Content>
            </Button>
按钮>
但我想创建用户想要的任意多的按钮,并根据用户的需要使用不同的文本框值。但是我找不到任何方法,请帮助我。
谢谢

在项目中使用此代码创建一个
自定义用户控件
。此后,在代码隐藏的主页中,以for循环或任何其他适合您的情况的方法将userControl动态添加到UI上的网格中