appControlSignal = null;
}
- win?.Dispose();
- win = null;
+ window?.Dispose();
+ window = null;
base.Dispose(type);
}
private NUIApplicationAppControlEventCallbackDelegate applicationAppControlEventCallbackDelegate;
private ApplicationControlSignal appControlSignal;
- private Window win;
+ private Window window;
/**
* @brief Event for Initialized signal which can be used to subscribe/unsubscribe the event handler
{
// Initialize DisposeQueue Singleton class. This is also required to create DisposeQueue on main thread.
DisposeQueue.Instance.Initialize();
+ Window.Instance = GetWindow();
// Notify that the window is displayed to the app core.
if (NUIApplication.IsPreload)
public Window GetWindow()
{
- win = Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindow(SwigCPtr)) as Window;
- if (win == null)
+ if (window != null)
{
- win = new Window(Interop.Application.GetWindow(SwigCPtr), true);
+ return window;
}
+ window = (Registry.GetManagedBaseHandleFromNativePtr(Interop.Application.GetWindow(SwigCPtr)) as Window) ?? new Window(Interop.Application.GetWindow(SwigCPtr), true);
+
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- return win;
+ return window;
}
public static string GetResourcePath()
/// <since_tizen> 3 </since_tizen>
public partial class Window : BaseHandle
{
- private static readonly Window instance = Application.Instance?.GetWindow();
-
private HandleRef stageCPtr;
private Layer rootLayer;
private string windowTitle;
/// Gets the current window.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
- public static Window Instance
- {
- get
- {
- return instance;
- }
- }
+ public static Window Instance { get; internal set; }
/// <summary>
/// Gets or sets a window type.