static SemaphoreSlim SaveSemaphore = new SemaphoreSlim(1, 1);
- static Lazy<DelegateLogListener> _applicationOutputListener;
- static bool _logWarningsToApplicationOutput;
-
- public static bool LogWarningsToApplicationOutput
- {
- get => _logWarningsToApplicationOutput;
- set
- {
- _logWarningsToApplicationOutput = value;
-
- if (_logWarningsToApplicationOutput)
- {
- if (!Log.Listeners.Contains(_applicationOutputListener.Value))
- {
- Log.Listeners.Add(_applicationOutputListener.Value);
- }
- }
- else
- {
- if (Log.Listeners.Contains(_applicationOutputListener.Value))
- {
- Log.Listeners.Remove(_applicationOutputListener.Value);
- }
- }
- }
- }
+ [Obsolete("Assign the LogWarningsListener")]
+ public static bool LogWarningsToApplicationOutput { get; set; }
bool MainPageSet { get; set; }
-
public Application()
{
SystemResources = DependencyService.Get<ISystemResourcesProvider>().GetSystemResources();
SystemResources.ValuesChanged += OnParentResourcesChanged;
_platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<Application>>(() => new PlatformConfigurationRegistry<Application>(this));
- _applicationOutputListener = new Lazy<DelegateLogListener>(() => new DelegateLogListener((arg1, arg2) =>
- {
- Debug.WriteLine($"{arg1}: {arg2}");
- }));
}
public void Quit()
bool converted = (privateAttributes & SetValuePrivateFlags.Converted) != 0;
if (property == null)
- throw new ArgumentNullException("property");
+ throw new ArgumentNullException(nameof(property));
if (checkAccess && property.IsReadOnly)
{
- Debug.WriteLine("Can not set the BindableProperty \"{0}\" because it is readonly.", property.PropertyName);
+ Log.Warning("BindableObject", "Can not set the BindableProperty \"{0}\" because it is readonly.", property.PropertyName);
return;
}
if (newValue != null && lv.GroupDisplayBinding != null)
{
lv.GroupDisplayBinding = null;
- Debug.WriteLine("GroupHeaderTemplate and GroupDisplayBinding can not be set at the same time, setting GroupDisplayBinding to null");
+ Log.Warning("ListView", "GroupHeaderTemplate and GroupDisplayBinding can not be set at the same time, setting GroupDisplayBinding to null");
}
}
return true;
}
}
-}
\ No newline at end of file
+}