Quantcast
Channel: Caliburn.Micro: Xaml Made Easy
Viewing all articles
Browse latest Browse all 1760

New Post: Thank you.... and one final question

$
0
0
You can create a list of scores groups, with specific view-models and views.

What I mean is, every set of scores has to be wrapped in a ScoresGroupViewModel, something like
publicclass ScoresGroupViewModel : PropertyChangedBase, IHaveDisplayName
{
         publicstring DisplayName { get { ... } set { ... } }  //Store here the 'name' of the group, just like "ABCScores"...public ObservableCollection<ScoreViewModel> Scores { get; privateset; }

         //Code omitted...
}
Every group would use the same view
<UserControl...><ListBoxx:Name="Scores".../><!-- Other than the individual scores, a proper header should be provided, displaying the DisplayName for group of scores --></UserControl>
The view-model exposing all grouped scores, will use a simple ItemsControl to display all listboxes
<UserControl...><ItemsControlx:Name="ScoreGroups"/><!-- Use the appropriate Panel here... probably a vertical oriented StackPanel would suffice --></UserControl>
With this approach, scores groups are defined through view-model, and the view is dinamically built. In case a specific group needs a different view, you can inherit from the base view-model class, put there some more logic and create a specifica view (something like 'Other scores, where just brief informations are displayed).

I hope this makes sense to you. Feel free to ask. :)

Viewing all articles
Browse latest Browse all 1760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>