我需要做如下图所示的事情:
Disposition http://img560.imageshack.us/img560/8721/dispo16042013134903.png
水平滚动时需要冻结人(1),垂直滚动时需要冻结日期(2)。所以人们可以总是说这个$ Person在$ Date上做...(4)。 此外,还需要显示每个人做某事的其他信息(3)。
目前我的数据结构如何: 人 - >天词典 - > ObservableCollection当天所做的事情(可以是多件事)
我怎样才能以良好的WPF方式做到这一点?最好这样我只能将DataContext设置为我的Person集合,其他一切都由WPF完成。
感谢您的帮助。
编辑:
Public Class DispoPersonViewModel
Inherits ViewModelBase
Implements iScheduleOrganizer
Private _dbContext As infosoftEntities
Private WithEvents _Person As Person
Private _DictAZGSchedule As New Concurrent.ConcurrentDictionary(Of Date, DispoAZGScheduleViewModel)
Public Sub New(ByVal Person As Person, Optional ByVal dbContext As IDBContext
'Getting the data for the person
End Sub
Public ReadOnly Property AZGSchedule(ByVal dat As Date) As BusinessObjects.AZG.AZGSchedule Implements iScheduleOrganizer.AZGSchedule
Get
Return Me._Person.AZGSchedule(dat)
End Get
End Property
'I omit the whole load and initialize and check functions here
End Class
和
Public Class DispoAZGScheduleViewModel
Inherits ViewModelBase
Private _Person As DispoPersonViewModel
Private WithEvents _AZGSchedule As AZG.AZGSchedule
Private WithEvents _lSchedule As ObservableCollection(Of DispoScheduleViewModel)
Public Sub New(AZGEinteilung As AZG.AZGSchedule, Person As DispoPersonViewModel)
'initializing the AZGSchedule
Using CSTeile.MyStack.Push("DispoAZGScheduleViewModel.New")
_AZGEinteilung = AZGEinteilung
_Person = Person
Dim lSched As New ObservableCollection(Of DispoScheduleViewModel)
For Each sc As Schedule In _AZGSchedule.ListAllSchedules.ToList
lSched.Add(New DispoScheduleViewModel(et, _Person, Me))
Next
_lSchedule = lSched
End Using
End Sub
Public ReadOnly Property ListAllSchedules As List(Of DispoScheduleViewModel)
Get
Using CSTeile.MyStack.Push("DispoAZGScheduleViewModel.ListAllEinteilung")
Return _lEinteilung.ToList
End Using
End Get
End Property
Public ReadOnly Property fc As AZG.AGZErrorCache 'for displaying errors
Get
Using CSTeile.MyStack.Push("DispoAZGScheduleViewModel.fc")
Return Me._AZGSchedule.fc.Result
End Using
End Get
End Property
'I omit here the whole hookup to my BussinessObjects it would get to much
End Class
现在我在代码隐藏中“构建”整个事情并且它没有完成我想要的所有事情并且渲染速度很慢: - (。