// Copyright 2016 by Samsung Electronics, Inc.,
//
// This software is the confidential and proprietary information
// of Samsung Electronics, Inc. ("Confidential Information"). You
// shall not disclose such Confidential Information and shall use
// it only in accordance with the terms of the license agreement
// you entered into with Samsung.
using System;
using Dali;
//------------------------------------------------------------------------------
//
//
// This file can only run on Tizen target. You should compile it with hello-test.cs, and
// add tizen c# application related library as reference.
//------------------------------------------------------------------------------
namespace Tizen.Applications
{
///
/// Represents an application that have UI screen. The DaliApplication class has a default stage.
///
public class DaliApplication : CoreUIApplication
{
///
/// The instance of the Dali Application.
///
///
/// This application is created before OnCreate() or created event. And the DaliApplication will be terminated when this application is closed.
///
protected Dali.Application application;
protected Dali.ApplicationExtensions applicationExt;
///
/// The instance of the Dali Stage.
///
public Stage stage { get; private set; }
///
/// Overrides this method if want to handle behavior before calling OnCreate().
/// stage property is initialized in this overrided method.
///
protected override void OnPreCreate()
{
application = Dali.Application.NewApplication();
applicationExt = new Dali::ApplicationExtensions(application);
applicationExt.Init();
stage = Stage.GetCurrent();
stage.SetBackgroundColor( NDalic.WHITE );
}
///
/// Overrides this method if want to handle behavior.
///
protected override void OnTerminate()
{
base.OnTerminate();
applicationExt.Terminate();
}
///
/// Overrides this method if want to handle behavior.
///
protected override void OnPause()
{
base.OnPause();
applicationExt.Pause();
}
///
/// Overrides this method if want to handle behavior.
///
protected override void OnResume()
{
base.OnResume();
applicationExt.Resume();
}
///
/// Overrides this method if want to handle behavior.
///
protected override void OnLocaleChanged(LocaleChangedEventArgs e)
{
base.OnLocaleChanged(e);
applicationExt.LanguageChange();
}
}
}