using Oobe.Common.Styles;
using Oobe.Common.Utils;
+using System;
using Tizen.NUI;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Components;
/// </summary>
public class BasePage : View
{
+ private const string hdBackgroundFile = "hd_whitebg.9.png";
+ private const string fhdBackgroundFile = "fhd_whitebg.9.png";
+ private const string uhdBackgroundFile = "uhd_whitebg.9.png";
private View content;
private View dimView;
FontStyle = new PropertyMap().AddLightFontStyle(),
};
dimView.Add(Title);
- BackgroundImage = NUIApplication.Current.DirectoryInfo.Resource + "page/0_BG_WHITEsmall.png";
Add(dimView);
+ SetBackground();
+ }
+
+ private void SetBackground()
+ {
+ var visualMap = new NPatchVisual();
+ visualMap.URL = GetBackgroundUrl();
+ Background = visualMap.OutputVisualMap;
+ }
+
+ private string GetBackgroundUrl()
+ {
+ string filename = hdBackgroundFile;
+ int biggerEdge = Math.Max(Window.Instance.WindowSize.Width, Window.Instance.WindowSize.Height);
+ if (biggerEdge > 3000)
+ {
+ filename = fhdBackgroundFile;
+ }
+ else if (biggerEdge < 1500)
+ {
+ filename = uhdBackgroundFile;
+ }
+
+ string bgUrl = NUIApplication.Current.DirectoryInfo.Resource + $"page/{filename}";
+ return bgUrl;
}
/// <summary>