private void ReinitializeLayout()
{
- if (ItemsSource == null || ItemsLayouter == null || ItemTemplate == null)
+ var localItemsLayouter = ItemsLayouter;
+ if (ItemsSource == null || localItemsLayouter == null || ItemTemplate == null)
{
return;
}
itemsLayouter.Clear();
ClearCache();
- ItemsLayouter.Initialize(this);
+ localItemsLayouter.Initialize(this);
needInitalizeLayouter = false;
}
- ItemsLayouter.RequestLayout(0.0f, true);
+ localItemsLayouter.RequestLayout(0.0f, true);
if (delayedScrollTo)
{
if (ScrollingDirection == Direction.Horizontal)
{
- ContentContainer.SizeWidth = (float)ItemsLayouter?.CalculateLayoutOrientationSize();
+ ContentContainer.SizeWidth = (float)localItemsLayouter.CalculateLayoutOrientationSize();
}
else
{
- ContentContainer.SizeHeight = (float)ItemsLayouter?.CalculateLayoutOrientationSize();
+ ContentContainer.SizeHeight = (float)localItemsLayouter.CalculateLayoutOrientationSize();
}
}
public static readonly BindableProperty LowIndicatorSizeProperty = BindableProperty.Create(nameof(LowIndicatorSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (Slider)bindable;
- if (newValue != null)
+ if (newValue as Size is var nVal && nVal != null)
{
- instance.InternalLowIndicatorSize = newValue as Size;
+ instance.InternalLowIndicatorSize = nVal;
}
},
defaultValueCreator: (bindable) =>
public static readonly BindableProperty HighIndicatorSizeProperty = BindableProperty.Create(nameof(HighIndicatorSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (Slider)bindable;
- if (newValue != null)
+ if (newValue as Size is var nVal && nVal != null)
{
- instance.InternalHighIndicatorSize = newValue as Size;
+ instance.InternalHighIndicatorSize = nVal;
}
},
defaultValueCreator: (bindable) =>
public static readonly BindableProperty ValueIndicatorSizeProperty = BindableProperty.Create(nameof(ValueIndicatorSize), typeof(Size), typeof(Slider), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (Slider)bindable;
- if (newValue != null)
+ if (newValue as Size is var nVal && nVal != null)
{
- instance.InternalValueIndicatorSize = newValue as Size;
+ instance.InternalValueIndicatorSize = nVal;
}
},
defaultValueCreator: (bindable) =>
{
if (this.IsDisposeQueued)
{
- var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+ using var process = global::System.Diagnostics.Process.GetCurrentProcess();
+ var processId = process.Id;
var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
var me = this.GetType().FullName;
//in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked!
Tizen.Log.Error("NUI", "in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked! just return here! \n" +
- $"process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
+ $"process:{processId} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
return;
}
}
{
if (keyInputFocusLostEventHandler != null)
{
- var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+ using var process = global::System.Diagnostics.Process.GetCurrentProcess();
+ var processId = process.Id;
var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
var me = this.GetType().FullName;
throw new ObjectDisposedException(nameof(SwigCPtr), $"Error! NUI's native dali object is already disposed. " +
$"OR the native dali object handle of NUI becomes null! \n" +
- $" process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
+ $" process:{processId} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
}
}
else
{
if (this.IsDisposeQueued)
{
- var process = global::System.Diagnostics.Process.GetCurrentProcess().Id;
+ using var process = global::System.Diagnostics.Process.GetCurrentProcess();
+ var processId = process.Id;
var thread = global::System.Threading.Thread.CurrentThread.ManagedThreadId;
var me = this.GetType().FullName;
//in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked!
Tizen.Log.Error("NUI", "in this case, the View object is ready to be disposed waiting on DisposeQueue, so event callback should not be invoked! just return here! \n" +
- $"process:{process} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
+ $"process:{processId} thread:{thread}, isDisposed:{this.Disposed}, isDisposeQueued:{this.IsDisposeQueued}, me:{me}\n");
return;
}
}