我想在单击按钮时一个一个地添加 Listpickers,同时向下到 Listpickers 的控件应该在每次添加 listpicker 时向下移动。请给我一个想法。
用于创建列表选择器的 XAML 代码。
<toolkit:ListPicker Grid.Row="0" Margin="5,76,226,-52" x:Name="list" ItemTemplate="{StaticResource PickerItemTemplate}" ItemCountThreshold="3"
FullModeItemTemplate="{StaticResource PickerFullModeItemTemplate}" FullModeHeader="Select your Monthly Debts:" SelectedIndex="2" CacheMode="BitmapCache"
FontFamily="Arial Black" FontSize="32" FontWeight="ExtraBlack"/>
C#代码:
List<payment> source = new List<payment>();
source.Add(new payment() { Name = "Car Payment" });
source.Add(new payment() { Name = "Credit UnionLoan" });
source.Add(new payment() { Name = "Spousal Support" });
source.Add(new payment() { Name = "Child Support" });
source.Add(new payment() { Name = "Visa" });
source.Add(new payment() { Name = "MasterCard" });
this.list.ItemsSource = source;
支付类文件:
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace NewUIChanges
{
public class payment
{
public string Name
{
get;
set;
}
}
}