Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
use interlock increment
Browse files Browse the repository at this point in the history
  • Loading branch information
StephaneDelcroix committed Nov 29, 2018
1 parent c95cbb9 commit 22a43c3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Xamarin.Forms.Core/DataTemplate.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading;
using Xamarin.Forms.Internals;

namespace Xamarin.Forms
Expand All @@ -18,14 +19,14 @@ public DataTemplate()

public DataTemplate(Type type) : base(type)
{
_id = Interlocked.Increment(ref idCounter);
_idString = type.FullName;
_id = idCounter++;
}

public DataTemplate(Func<object> loadTemplate) : base(loadTemplate)
{
_idString = GetType().FullName + idCounter++;
_id = idCounter;
_id = Interlocked.Increment(ref idCounter);
_idString = GetType().FullName + _id;
}

public IDictionary<BindableProperty, BindingBase> Bindings { get; } = new Dictionary<BindableProperty, BindingBase>();
Expand Down

0 comments on commit 22a43c3

Please sign in to comment.