From the course: .NET MAUI Essential Training

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Databinding configuration

Databinding configuration

- [Instructor] We're going to make some updates to our bindings here and we're going to do that in two steps. Step one, we're going to fix the model to get rid of this TimeSpan so we're not binding to a path of period. And step two is we're going to introduce a converter to convert between TimeSpans and strings. So let's go to our StaggeredIntervalModel here. Remember we have our durations that are of type TimeSpan and we have a TotalDuration that essentially sums those up. So I'm just going to add a new class here real quick. We'll call it IntervalDuration. I'm going to put a property on it. We'll make that a TimeSpan and we'll call that Duration. Now we'll use this IntervalDuration instead of TimeSpan in a number of places. So we're going to change our collection here to those and we're going to have to change our sum so that we use that duration property now to get at the TimeSpan tick. Another important piece of our data…

Contents