switch (ModelName)
{
case PlatformModel.Emulator:
- DebuggingUtils.Dbg("Emulator, Font size = " + fontBaseSize + " => " + ((double)((double)fontBaseSize / (double)BaseScreenHeight) * (double)ScreenHeight) * ScaleRatio);
+ //DebuggingUtils.Dbg("Emulator, Font size = " + fontBaseSize + " => " + ((double)((double)fontBaseSize / (double)BaseScreenHeight) * (double)ScreenHeight) * ScaleRatio);
return Convert.ToInt32(((double)((double)fontBaseSize / (double)BaseScreenHeight) * (double)ScreenHeight) * ScaleRatio);
default:
case PlatformModel.TV:
// TODO : Remove this if the TV/Other device's dpi is correctly changed.
double tempAdjustmentRatio = 0.3D;
- DebuggingUtils.Dbg("TV/Other, Font size = " + fontBaseSize + " => " + ((double)((double)fontBaseSize / (double)BaseScreenHeight) * (double)ScreenHeight) * ScaleRatio * tempAdjustmentRatio);
+ //DebuggingUtils.Dbg("TV/Other, Font size = " + fontBaseSize + " => " + ((double)((double)fontBaseSize / (double)BaseScreenHeight) * (double)ScreenHeight) * ScaleRatio * tempAdjustmentRatio);
return Convert.ToInt32(((double)((double)fontBaseSize / (double)BaseScreenHeight) * (double)ScreenHeight) * ScaleRatio * tempAdjustmentRatio);
}
}
using Xamarin.Forms;
using System;
using TVApps.Views;
+using System.Runtime.CompilerServices;
namespace TVApps.ViewModels
{
public Command ButtonDeleteAppCommand { get; set; }
/// <summary>
- /// A command will be executed if the ok button in FooterPinStatus is clicked
+ /// A command will be executed if the done button in FooterPinStatus is clicked
/// </summary>
/// <see cref="FooterPinStatus"/>
- public Command ButtonPinOkCommand { get; set; }
-
- /// <summary>
- /// A command will be executed if the cancel button in FooterPinStatus is clicked
- /// </summary>
- /// <see cref="FooterPinStatus"/>
- public Command ButtonPinCancelCommand { get; set; }
+ public Command ButtonPinDoneCommand { get; set; }
/// <summary>
/// Gets and Sets current status of MainPageViewModel
/// </summary>
public event PropertyChangedEventHandler PropertyChanged;
+ private bool isPinAppRequested = false;
/// <summary>
/// A flag indicates whether pin app is requested or not
/// If TV Home requests pin app to TV Apps, IsPinAppRequested will be true
/// </summary>
- private bool IsPinAppRequested;
+ public bool IsPinAppRequested
+ {
+ get
+ {
+ return isPinAppRequested;
+ }
+
+ set
+ {
+ isPinAppRequested = value;
+ OnPropertyChanged();
+ }
+ }
/// <summary>
/// Constructor
ChangeCurrentStatus(AppsStatus.Delete);
});
- ButtonPinOkCommand = new Command(() =>
+ ButtonPinDoneCommand = new Command(() =>
{
- appsHolder.UpdatePinnedApps();
ChangeCurrentStatus(AppsStatus.Default);
if (IsPinAppRequested)
{
- // TODO : check pinned apps and a number of pinned apps
AppControlUtils.SendAppAddedNotificationToHome("org.tizen.settings");
AppControlUtils.SelfTerminate();
}
});
- ButtonPinCancelCommand = new Command(() =>
- {
- appsHolder.ResetPinnedApps();
- ChangeCurrentStatus(AppsStatus.Default);
-
- OnPropertyChanged("SumOfCheckedApp");
-
- if (IsPinAppRequested)
- {
- AppControlUtils.SelfTerminate();
- }
- });
-
DeletePopupCommand = new Command<Dictionary<string, string>>(async (arg) =>
{
string answer;
App.SetPinAppRequestListener((s, e) =>
{
- // TODO : check concurrency
IsPinAppRequested = true;
ChangeCurrentStatus(AppsStatus.Pin);
});
/// <summary>
/// A method for invoking PropertyChanged event
/// </summary>
- /// <param name="name">The name of property</param>
- public void OnPropertyChanged(string name)
+ /// <param name="propertyName">The name of property</param>
+ public void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChangedEventHandler handler = PropertyChanged;
if (handler != null)
{
- handler(this, new PropertyChangedEventArgs(name));
+ handler(this, new PropertyChangedEventArgs(propertyName));
}
}
}
set { SetValue(IsEnabledDeletePopupProperty, value); }
}
+ /// <summary>
+ /// Identifies the pin app control request received information bindable property
+ /// </summary>
+ public static readonly BindableProperty IsPinAppRequestedProperty = BindableProperty.Create("IsPinAppRequested", typeof(bool), typeof(MainPage), default(bool));
+
+ /// <summary>
+ /// Gets or sets whether pin app control request received information.
+ /// </summary>
+ public bool IsPinAppRequested
+ {
+ get { return (bool)GetValue(IsPinAppRequestedProperty); }
+ set { SetValue(IsPinAppRequestedProperty, value); }
+ }
+
/// <summary>
/// Identifies the delete popup command bindable property
/// </summary>
/// <see cref="Page.OnBackButtonPressed"/>
protected override bool OnBackButtonPressed()
{
+ if (IsPinAppRequested)
+ {
+ return false;
+ }
+
SynchronizationContext.Current.Post(async (o) =>
{
await OnBackKeyPressedAtMain();