e.Application = this;
_applicationTerminateEventHandler.Invoke(this, e);
}
- if (Window.Instance)
+
+ List<Window> windows = GetWindowList();
+ foreach (Window window in windows)
{
- Window.Instance.DisconnectNativeSignals();
+ window?.DisconnectNativeSignals();
}
}
string resource = Tizen.Applications.Application.Current.DirectoryInfo.Resource;
Tizen.Log.Fatal("NUI", "the resource path: " + resource);
- int windowWidth = Window.Instance.Size.Width;
- int windowHeight = Window.Instance.Size.Height;
+ int windowWidth = NUIApplication.GetDefaultWindow().Size.Width;
+ int windowHeight = NUIApplication.GetDefaultWindow().Size.Height;
string likelyResourcePath = resource + "layout/" + windowWidth.ToString() + "x" + windowHeight.ToString() + "/" + resourceName;
Tizen.Log.Fatal("NUI", "the resource path: " + likelyResourcePath);
NUILog.Debug($"resource=({resource})");
- int windowWidth = Window.Instance.Size.Width;
- int windowHeight = Window.Instance.Size.Height;
+ int windowWidth = NUIApplication.GetDefaultWindow().Size.Width;
+ int windowHeight = NUIApplication.GetDefaultWindow().Size.Height;
string likelyResourcePath = resource + "layout/" + windowWidth.ToString() + "x" + windowHeight.ToString() + "/" + resourceName;
/// <code>
/// LottieAnimationView myLottie = new LottieAnimationView();
/// myLottie.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "myLottie.json"; //myLottie.json's total frame is 100 (frame: 0~99)
- /// Window.Instance.GetDefaultLayer().Add(myLottie);
+ /// NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(myLottie);
/// myLottie.CurrentFrame = 200; //display 99 frame
/// myLottie.SetMinMaxFrame(10, 20);
/// myLottie.CurrentFrame = 15; //display 15 frame
/// <code>
/// LottieAnimationView myLottie = new LottieAnimationView();
/// myLottie.URL = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "myLottie.json"; //myLottie.json's total frame is 100 (frame: 0~99)
- /// Window.Instance.GetDefaultLayer().Add(myLottie);
+ /// NUIApplication.GetDefaultWindow().GetDefaultLayer().Add(myLottie);
/// myLottie.LoopCount = -1; //infinite loop
/// myLottie.Play();
/// myLottie.Stop(); //it plays continuously unless Stop() is called
private void SendViewAddedEventToWindow(IntPtr data)
{
- Window.Instance?.SendViewAdded(this);
+ NUIApplication.GetDefaultWindow()?.SendViewAdded(this);
}
[UnmanagedFunctionPointer(CallingConvention.StdCall)]
if (WindowWheelEventHandler == null)
{
- Window.Instance.WheelEvent += OnWindowWheelEvent;
+ NUIApplication.GetDefaultWindow().WheelEvent += OnWindowWheelEvent;
}
WindowWheelEventHandler += value;
}
WindowWheelEventHandler -= value;
if (WindowWheelEventHandler == null)
{
- Window.Instance.WheelEvent -= OnWindowWheelEvent;
+ NUIApplication.GetDefaultWindow().WheelEvent -= OnWindowWheelEvent;
}
}
}
if (WindowWheelEventHandler != null)
{
- Window.Instance.WheelEvent -= OnWindowWheelEvent;
+ NUIApplication.GetDefaultWindow().WheelEvent -= OnWindowWheelEvent;
}
if (_hoverEventCallback != null)
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual float ConvertToPixel(float value)
{
- return value * (Window.Instance.Dpi.X / defaultDpi);
+ return value * (NUIApplication.GetDefaultWindow().Dpi.X / defaultDpi);
}
/// <summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public virtual float ConvertFromPixel(float value)
{
- return value * (defaultDpi / Window.Instance.Dpi.X);
+ return value * (defaultDpi / NUIApplication.GetDefaultWindow().Dpi.X);
}
}
}
public Layer() : this(Interop.Layer.Layer_New(), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
- if (Window.Instance != null)
- {
- this.SetAnchorPoint(Tizen.NUI.PivotPoint.TopLeft);
- this.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.AllDimensions);
- }
+ this.SetAnchorPoint(Tizen.NUI.PivotPoint.TopLeft);
+ this.SetResizePolicy(ResizePolicyType.FillToParent, DimensionType.AllDimensions);
}
internal Layer(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Layer.Layer_SWIGUpcast(cPtr), cMemoryOwn)
{
if (!childLayout.IsReplaceFlag())
{
- Window.Instance.LayoutController.AddToRemovalStack(childLayout);
+ NUIApplication.GetDefaultWindow().LayoutController.AddToRemovalStack(childLayout);
}
childLayout.ConditionForAnimation = childLayout.ConditionForAnimation | TransitionCondition.Remove;
// Add LayoutItem to the transition stack so can animate it out.
- Window.Instance.LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
+ NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(new LayoutData(layoutItem, ConditionForAnimation, 0, 0, 0, 0));
}
else
{
if (Owner.Parent != null && Owner.Parent.Layout != null && Owner.Parent.Layout.LayoutWithTransition)
{
- Window.Instance.LayoutController.AddTransitionDataEntry(_layoutPositionData);
+ NUIApplication.GetDefaultWindow().LayoutController.AddTransitionDataEntry(_layoutPositionData);
}
else
{
{
get
{
- return Window.Instance;
+ return GetDefaultWindow();
}
}
/// Instead please use FocusChanged.
[Obsolete("Please do not use! This will be deprecated! Please use FocusChanged instead! " +
"Like: " +
- "Window.Instance.FocusChanged = OnFocusChanged; " +
+ "NUIApplication.GetDefaultWindow().FocusChanged = OnFocusChanged; " +
"private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler<FocusChangedEventArgs> WindowFocusChanged
/// <since_tizen> 3 </since_tizen>
[Obsolete("Please do not use! This will be deprecated! Please use FocusChangedEventArgs instead! " +
"Like: " +
- "Window.Instance.FocusChanged = OnFocusChanged; " +
+ "NUIApplication.GetDefaultWindow().FocusChanged = OnFocusChanged; " +
"private void OnFocusChanged(object source, Window.FocusChangedEventArgs args) {...}")]
[EditorBrowsable(EditorBrowsableState.Never)]
public class WindowFocusChangedEventArgs : EventArgs
/// <since_tizen> 4 </since_tizen>
public SafeNativeWindowHandle() : base(IntPtr.Zero, false)
{
- SetHandle(Tizen.NUI.Window.Instance.GetNativeWindowHandler());
+ SetHandle(NUIApplication.GetDefaultWindow().GetNativeWindowHandler());
}
/// <summary>
/// Null check if the handle is valid or not.
//because the execution order of Finalizes is non-deterministic.
if(Root != null)
{
- Window.Instance.Remove(Root);
+ Root.Unparent();
Root.Dispose();
Root = null;
}
if ( Root != null )
{
//Remove it from the window
- Window.Instance.Remove(Root);
+ Root.Unparent();
Root.Dispose();
Root = null;
Root = new View();
Root.WidthResizePolicy = ResizePolicyType.FillToParent;
Root.HeightResizePolicy = ResizePolicyType.FillToParent;
- Window.Instance.Add(Root);
+ NUIApplication.GetDefaultWindow().Add(Root);
ClearHandler();
}