|
<DataTemplate x:Key="KanbanCardTemplate">
…..
<ScrollViewer Grid.Row="2" Grid.ColumnSpan="1" VerticalAlignment="Bottom"
Margin="0,4,0,2"
Visibility="{Binding Tag.CardStyle.TagVisibility ,
RelativeSource={RelativeSource Mode=TemplatedParent}}"
HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Disabled">
<ItemsControl ItemsSource="{Binding TagsCollection}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<ItemsWrapGrid x:Name="ItemWrapGrid" MaximumRowsOrColumns="3"
ItemHeight="30" ItemWidth="70" DataContext="{Binding}"
Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<Border BorderThickness="2" BorderBrush="Gray" Margin="5">
<TextBlock HorizontalAlignment="Center" FontSize="10"
Text="{Binding}"/>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ItemsControl>
</ScrollViewer>
</DataTemplate> |
|
public class KanbanModelExt : IKanbanModel
{
…
private ObservableCollection<string> tagsCollection;
public ObservableCollection<string> TagsCollection
{
get
{
return this.tagsCollection;
}
set
{
this.tagsCollection = value;
this.NotifyPropertyChanged("TagsCollection");
}
}
…
} |
|
…
public static string CallTaskStartTime(string selectedTaskID)
{
….
DispatcherTimer timer1 = new DispatcherTimer();
timer1.Interval = TimeSpan.FromSeconds(1);
timer1.Start();
timer1.Tick += (sen, e) =>
{
Tasks[taskIndex].TagsCollection[0] = count.ToString();
count++;
};
….
} |
|
// Create new timer
Timer taskTimer = new Timer((o) =>
{
// Get current task activity seconds and increment one more
double taskSeconds = TimeSpan.Parse(Tasks[taskIndex].TagsCollection[0]).TotalSeconds;
taskSeconds += 1;
TimeSpan taskTime = TimeSpan.FromSeconds(taskSeconds);
// Update tag with new time
}, null, 1000, 1000); // Run inner code after 1 second and then each second
Timer.oTasksTimers.Add(selectedTaskID, taskTimer); |