In a current project, I have a list of objects. And 2 of the properties are of type string[].
Currently I'm able to display the amount of items with their primary identifier. But alongside that I want to display all the different strings in the designated string[].
The class looks like this:
public class TimeStamp
{
public int ID { get; set; }
public string[] DaysOfWeek { get; set; }
public string[] HoursOfDay { get; set; }
}
In my page, I have the following (working as described above)
<ListView x:Name="listboxFolder1" Grid.Row="2" Margin="5" Grid.ColumnSpan="4"
ItemsSource="{Binding}">
<ListView.ItemTemplate>
<DataTemplate>
<Border BorderBrush="Blue" Margin="3" Padding="3" BorderThickness="2" CornerRadius="0 25 0 25" Background="Beige" HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal">
<Image Margin="10" Width="50" Height="50" Stretch="Fill" Source="/Images/watch.png">
<Image.BitmapEffect>
<DropShadowBitmapEffect />
</Image.BitmapEffect>
</Image>
<StackPanel Orientation="Vertical" VerticalAlignment="Center">
<TextBlock Text="{Binding ID}"/>
<TextBlock Text="{Binding DaysOfWeek}"/>
</StackPanel>
</StackPanel>
</Border>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
And for completion, the setting of the binding:
static List<iBackupModel.Models.TimeStamp> mySchedules { get; set; }
public Scheduler()
{
InitializeComponent();
listboxFolder1.ItemsSource = Home.mySettings.TimeStamps;
}
But the DaysOfWeek gets displayed like: String[]-matrix.
I would like it to be something like "monday|friday|sunday".
If it would be possible to match this with a fixed set (in this case all the weekdays) and put a strikethrough through all the missing items, that would be great, but I would already be thankful for the first.
Is this possible?
For both the first and the second option?
Any help is more then welcome. Thanks in advance.