[DllImport(Libraries.Application, EntryPoint = "ui_app_remove_event_handler")]
internal static extern ErrorCode RemoveEventHandler(IntPtr handle);
+ [DllImport(Libraries.Application, EntryPoint = "ui_app_get_window_position")]
+ internal static extern ErrorCode GetWindowPosition(out int x, out int y, out int w, out int h);
[NativeStruct("ui_app_lifecycle_callback_s", Include="app.h", PkgConfig="capi-appfw-application")]
[StructLayout(LayoutKind.Sequential)]
*/
using System;
+using System.ComponentModel;
using Tizen.Applications.CoreBackend;
+using Tizen.Internals.Errors;
namespace Tizen.Applications
{
{
Paused?.Invoke(this, EventArgs.Empty);
}
+
+ /// <summary>
+ /// Gets the window position of the application.
+ /// </summary>
+ /// <returns>The window position.</returns>
+ /// <exception cref="InvalidOperationException">Thrown when there is no window position.</exception>
+ /// <since_tizen> 11 </since_tizen>
+ public WindowPosition GetWindowPosition()
+ {
+ ErrorCode err = Interop.Application.GetWindowPosition(out int x, out int y, out int w, out int h);
+ if (err != ErrorCode.None)
+ {
+ throw new InvalidOperationException("Failed to get window position");
+ }
+
+ return new WindowPosition(x, y, w, h);
+ }
}
}