我正在为以下屏幕使用 poco 类,但我只是想知道如何实现此屏幕的上下移动元素
我正在使用 ObservableCollection 将我的项目添加到相互列表中,我的问题是如何实现上移和下移。我不,我需要实时更改 poco 类,但不确定我将如何实现这一点
private void AddColumn(object sender, RoutedEventArgs e)
{
if (this.WizardData == null)
return;
if (this.WizardData.ConcreteCustomColumnsProxy == null)
this.WizardData.ConcreteCustomColumnsProxy = new ObservableCollection<CustomColumnsModel>();
this.WizardData.ConcreteCustomColumnsProxy.Add(new CustomColumnsModel() { CustomColumnsDisplayName = txtDsiplayName.Text
, CustomColumnsOrder = 1, CustomColumnsWidth = Convert.ToInt32(txtWdith.Text) });
this.listView1.ItemsSource = this.WizardData.ConcreteCustomColumnsProxy;
this.listView1.UnselectAll();
this.listView1.Items.Refresh();
我的 Poco 课程如下
public event PropertyChangedEventHandler PropertyChanged;
public const string IdPropertyName = "CustomColumnsID";
private Guid _Id = Guid.Empty;
public Guid CustomColumnsID
{
get { return _Id; }
set
{
if (_Id == value)
return;
_Id = value;
NotifyPropertyChanged(IdPropertyName);
}
}
public string CustomColumnsDisplayName { get; set; }
public int CustomColumnsWidth { get; set; }
public int CustomColumnsOrder { get; set; }
protected void NotifyPropertyChanged(string key)
{
if (this.PropertyChanged != null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(key));
}
}
public EnterpriseManagementObject ActualData { get; private set; }
}