* limitations under the License.
*/
-using System;
-using System.Threading;
+using Tizen.Applications;
using LibTVRefCommonPortable.Utils;
using LibTVRefCommonTizen.Ports;
-using Tizen.Applications;
-using ElmSharp;
namespace TVHome.TizenTV
{
+ /// <summary>
+ /// TV Home application main entry point
+ /// </summary>
class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication
{
+ /// <summary>
+ /// A interface for the platform notification
+ /// </summary>
IPlatformNotification notification;
+ /// <summary>
+ /// A port for handling Window APIs
+ /// </summary>
WindowPort windowPort;
+ /// <summary>
+ /// Gets or set the application resource path
+ /// </summary>
public static string AppResourcePath
{
get;
private set;
}
+ /// <summary>
+ /// Gets or set the application data path
+ /// </summary>
public static string AppDataPath
{
get;
private set;
}
+ /// <summary>
+ /// A method will be called when application is created
+ /// </summary>
protected override void OnCreate()
{
base.OnCreate();
windowPort.SetKeyGrabExclusively(ElmSharp.EvasKeyEventArgs.PlatformHomeButtonName);
}
+ /// <summary>
+ /// A method will be called when application receives KeyUp event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">A EvasKey event's argument</param>
private void KeyUpListener(object sender, ElmSharp.EvasKeyEventArgs e)
{
DbgPort.D("Key Pressed :" + e.KeyName);
}
}
+ /// <summary>
+ /// A method will be called when application is terminated
+ /// </summary>
protected override void OnTerminate()
{
base.OnTerminate();
MainWindow.KeyUngrab(ElmSharp.EvasKeyEventArgs.PlatformMenuButtonName);
}
+ /// <summary>
+ /// A method will be called when application receives app control
+ /// </summary>
+ /// <param name="e">AppControl event argument</param>
protected override void OnAppControlReceived(AppControlReceivedEventArgs e)
{
if (AppControlPort.AppAddedNotifyOperation.CompareTo(e.ReceivedAppControl.Operation) == 0)
}
}
+ /// <summary>
+ /// The entry point for the application
+ /// </summary>
+ /// <param name="args">A list of command line arguments</param>
static void Main(string[] args)
{
var app = new Program();
namespace TVHome
{
+ /// <summary>
+ /// A custom EventArgs with string field
+ /// </summary>
public class TVHomeEventArgs : EventArgs
{
public string arg;
}
+ /// <summary>
+ /// A TVHomeStatus type enumeration
+ /// </summary>
public enum TVHomeStatus
{
OnStart,
OnResume,
}
+ /// <summary>
+ /// A class that represents TV Home application
+ /// </summary>
public class App : Application, IPlatformNotification
{
+ /// <summary>
+ /// A keyword for checking app status
+ /// </summary>
public static readonly string AppStatus = "appstatus";
+ /// <summary>
+ /// A event handler for handling Home key pressed event
+ /// </summary>
private static EventHandler<TVHomeEventArgs> HomeKeyListener;
+
+ /// <summary>
+ /// A event handler for handling Menu key pressed event
+ /// </summary>
private static EventHandler<TVHomeEventArgs> MenuKeyListener;
+
+ /// <summary>
+ /// A event handler for handling application installed event
+ /// </summary>
private static EventHandler<TVHomeEventArgs> AppInstalledListener;
+
+ /// <summary>
+ /// A event handler for handling application uninstalled event
+ /// </summary>
private static EventHandler<TVHomeEventArgs> AppUninstalledListener;
+
+ /// <summary>
+ /// A event handler for handling application pinned event
+ /// </summary>
private static EventHandler<TVHomeEventArgs> AppPinnedNotificationListener;
+ /// <summary>
+ /// A Constructor
+ /// Sets main page to MainPage instance
+ /// </summary>
public App()
{
MainPage = new MainPage();
}
+ /// <summary>
+ /// A method is called when the application starts
+ /// </summary>
protected override void OnStart()
{
MessagingCenter.Send<App, TVHomeStatus>(this, "appstatus", TVHomeStatus.OnStart);
}
+ /// <summary>
+ /// A method is called when the application enters the sleeping state
+ /// </summary>
protected override void OnSleep()
{
MessagingCenter.Send<App, TVHomeStatus>(this, "appstatus", TVHomeStatus.OnSleep);
}
+ /// <summary>
+ /// A method is called when the application resumes from a sleeping state
+ /// </summary>
protected override void OnResume()
{
MessagingCenter.Send<App, TVHomeStatus>(this, "appstatus", TVHomeStatus.OnResume);
}
+ /// <summary>
+ /// A method adds EventHandler to HomeKeyListener
+ /// </summary>
+ /// <param name="listener">The EventHandler for adding</param>
public static void SetHomeKeyListener(EventHandler<TVHomeEventArgs> listener)
{
HomeKeyListener += listener;
}
+ /// <summary>
+ /// A method adds EventHandler to MenuKeyListener
+ /// </summary>
+ /// <param name="listener">The EventHandler for adding</param>
public static void SetMenuKeyListener(EventHandler<TVHomeEventArgs> listener)
{
MenuKeyListener += listener;
}
+ /// <summary>
+ /// A method adds EventHandler to AppInstalledListener
+ /// </summary>
+ /// <param name="listener">The EventHandler for adding</param>
public static void SetAppInstalledListener(EventHandler<TVHomeEventArgs> listener)
{
AppInstalledListener += listener;
}
+ /// <summary>
+ /// A method adds EventHandler to AppUninstalledListener
+ /// </summary>
+ /// <param name="listener">The EventHandler for adding</param>
public static void SetAppUninstalledListener(EventHandler<TVHomeEventArgs> listener)
{
AppUninstalledListener += listener;
}
-
+
+ /// <summary>
+ /// A method adds EventHandler to AppPinnedNotificationListener
+ /// </summary>
+ /// <param name="listener">The EventHandler for adding</param>
public static void SetAppPinnedNotificationListener(EventHandler<TVHomeEventArgs> listener)
{
AppPinnedNotificationListener += listener;
}
+ /// <summary>
+ /// A method for handling home key pressed event
+ /// </summary>
public void OnHomeKeyPressed()
{
DebuggingUtils.Dbg("[[[ Home Key ]]] ");
});
}
+ /// <summary>
+ /// A method for handling menu key pressed event
+ /// </summary>
public void OnMenuKeyPressed()
{
DebuggingUtils.Dbg("\" Menu Key \" ");
});
}
+ /// <summary>
+ /// A method for handling application installed event
+ /// </summary>
+ /// <param name="pkgID">A installed package ID</param>
public void OnAppInstalled(string pkgID)
{
DebuggingUtils.Dbg("[[[ App Installed ]]] " + pkgID);
});
}
+ /// <summary>
+ /// A method for handling application uninstalled event
+ /// </summary>
+ /// <param name="pkgID">A uninstalled package ID</param>
public void OnAppUninstalled(string pkgID)
{
DebuggingUtils.Dbg("[[[ App Uninstalled ]]] " + pkgID);
});
}
+ /// <summary>
+ /// A method for receiving a pin app App Control request
+ /// </summary>
public void OnPinAppRequestReceived()
{
}
- public void OnAppPinnedNotificationReceived(String AppID)
+ /// <summary>
+ /// A method for receiving application pinned noficiation and invoke pinned event
+ /// </summary>
+ /// <param name="appID">A pinned app ID</param>
+ public void OnAppPinnedNotificationReceived(String appID)
{
- DebuggingUtils.Dbg("[[[ App Pinned ]]] " + AppID);
+ DebuggingUtils.Dbg("[[[ App Pinned ]]] " + appID);
AppPinnedNotificationListener.Invoke(this, new TVHomeEventArgs()
{
- arg = AppID,
+ arg = appID,
});
}
}
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+/*
+ * Copyright (c) 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Flora License, Version 1.1 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://floralicense.org/license/
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
namespace TVHome.ViewModels
{
+ /// <summary>
+ /// A interface for TV Home MainPageViewModel
+ /// </summary>
interface IHomeViewModel
{
+ /// <summary>
+ /// A method for invoking PropertyChanged event
+ /// </summary>
+ /// <param name="name">The name of property</param>
void OnPropertyChanged(string name);
+
+ /// <summary>
+ /// A method changes CurrentStatus according to parameter
+ /// </summary>
+ /// <param name="newStatus">The next status name</param>
+ /// <param name="isForceUpdate">A flag indicates whether CurrentStatus to be changed or not</param>
void ChangeCurrentStatus(HomeStatus newStatus, bool isForceUpdate);
}
}
namespace TVHome.ViewModels
{
+ /// <summary>
+ /// A HomeStatus type enumeration
+ /// </summary>
public enum HomeStatus
{
Default = 0,
UnPin,
Move,
};
+
+ /// <summary>
+ /// A HomeMenuItem type enumeration
+ /// </summary>
public enum HomeMenuItem
{
Recent = 0,
NotSelected,
};
+ /// <summary>
+ /// A class for ViewModel of TV Home
+ /// </summary>
public class MainPageViewModel : INotifyPropertyChanged, IHomeViewModel
{
+ /// <summary>
+ /// Gets or set MainList for MainPanel
+ /// </summary>
public IEnumerable<ShortcutInfo> MainList { get; set; }
+ /// <summary>
+ /// Gets or set RecentList for Recent SubPanel
+ /// </summary>
public IEnumerable<ShortcutInfo> RecentList { get; set; }
+ /// <summary>
+ /// Gets or set AppList for Apps SubPanel
+ /// </summary>
public IEnumerable<ShortcutInfo> AppList { get; set; }
+ /// <summary>
+ /// Gets or set SettingsList for Settings SubPanel
+ /// </summary>
public IEnumerable<ShortcutInfo> SettingsList { get; set; }
+ /// <summary>
+ /// A command for executing when MainPanel is focused.
+ /// </summary>
public Command MainPanelFocusedCommand { get; set; }
+ /// <summary>
+ /// A command for executing when SubPanel is focused.
+ /// </summary>
public Command SubPanelFocusedCommand { get; set; }
+ /// <summary>
+ /// A command for changing the status to Move status
+ /// </summary>
public Command SetMoveStatusCommand { get; set; }
+ /// <summary>
+ /// A command for changing the status to Unpin status
+ /// </summary>
public Command SetUnpinStatusCommand { get; set; }
+ /// <summary>
+ /// Gets or set CurrentStatus of HomeStatus
+ /// </summary>
public HomeStatus CurrentStatus { get; private set; }
+ /// <summary>
+ /// Gets or set SelectedMenuName of HomeMenuItem
+ /// </summary>
public HomeMenuItem SelectedMenuName { get; private set; }
+ /// <summary>
+ /// A flag indicates whether "No recent info" in Recent SubPanel to be displayed or not
+ /// </summary>
public bool IsShowNoRecentContents { get; set; }
+ /// <summary>
+ /// A event that is occurred when property of MainPageViewModel is changed
+ /// </summary>
public event PropertyChangedEventHandler PropertyChanged;
+ /// <summary>
+ /// Constructor
+ /// Initialize MainPanel, SubPanel, Command and EventListeners
+ /// </summary>
public MainPageViewModel()
{
// Init sequence
});
}
+ /// <summary>
+ /// A method for initializing HomeStatus to Default
+ /// </summary>
private void InitStatus()
{
ChangeCurrentStatus(HomeStatus.Default, true);
}
+ /// <summary>
+ /// A method for initializing commands
+ /// </summary>
private void InitCommands()
{
MainPanelFocusedCommand = new Command<HomeMenuItem>((key) =>
});
}
+ /// <summary>
+ /// A method for makeing MainMenu items and display in MainPanel
+ /// </summary>
private void MakeMainMenuItems()
{
string[] AppName = { "Recent", "Apps", "Settings" };
OnPropertyChanged("MainList");
}
+ /// <summary>
+ /// Gets default AppList for displaying items and updates the list to Apps SubPanel
+ /// </summary>
private void SetDefaultAppList()
{
AppList = TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetDefaultShortcuts();
OnPropertyChanged("AppList");
}
+ /// <summary>
+ /// Gets the AppList for displaying items and updates the list to Apps SubPanel
+ /// </summary>
+ /// <param name="sender">The source of event</param>
+ /// <param name="e">The event that is occurred pinned app file is changed</param>
private async void UpdateAppList(object sender, EventArgs e)
{
AppList = await TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetPinnedAppsWithDefaultShortcuts();
OnPropertyChanged("AppList");
}
+ /// <summary>
+ /// Gets the SettingsList for displaying items and updates the list to Settings SubPanel
+ /// </summary>
private void MakeSettingsButtons()
{
SettingsList = TVHomeImpl.GetInstance.SettingShortcutControllerInstance.GetList();
OnPropertyChanged("SettingsList");
}
+ /// <summary>
+ /// Gets the RecentList for displaying items and updates the list to Recent SubPanel
+ /// </summary>
private void MakeRecentButtons()
{
RecentList = TVHomeImpl.GetInstance.RecentShortcutControllerInstance.GetList();
OnPropertyChanged("IsShowNoRecentContents");
}
+ /// <summary>
+ /// A method for invoking PropertyChanged event
+ /// </summary>
+ /// <param name="name">The name of property</param>
public void OnPropertyChanged(string name)
{
PropertyChangedEventHandler handler = PropertyChanged;
}
}
+ /// <summary>
+ /// A method for changing CurrentStatus according to parameter
+ /// </summary>
+ /// <param name="newStatus">The next status name</param>
+ /// <param name="isForceUpdate">A flag indicates whether CurrentStatus to be changed or not</param>
public void ChangeCurrentStatus(HomeStatus newStatus, bool isForceUpdate = false)
{
if (isForceUpdate ||
}
}
+ /// <summary>
+ /// A method for changing selected HomeMenuItem according to parameter
+ /// </summary>
+ /// <param name="panelName">Selected menu name in MainPanel</param>
+ /// <param name="isForceUpdate">A flag indicates whether selected menu name to be changed or not</param>
public void ChangeSelectedPanelName(HomeMenuItem panelName, bool isForceUpdate = false)
{
if (isForceUpdate ||
* limitations under the License.
*/
-using System;
using System.Collections.Generic;
-using System.Diagnostics;
-using System.Windows.Input;
using LibTVRefCommonPortable.DataModels;
-using LibTVRefCommonPortable.Models;
using LibTVRefCommonPortable.Utils;
using Xamarin.Forms;
using TVHome.ViewModels;
-using System.Linq;
namespace TVHome.Views
{
/// <summary>
- /// Root Page of TV Home Application
+ /// A custom view for displaying main page of TV Home
/// </summary>
public partial class MainPage : ContentPage
{
+ /// <summary>
+ /// Identifies the CurrentStatus bindable property
+ /// </summary>
public static readonly BindableProperty CurrentStatusProperty = BindableProperty.Create("CurrentStatus", typeof(HomeStatus), typeof(MainPage), default(HomeStatus));
+
+ /// <summary>
+ /// Gets or sets current status of MainPage
+ /// </summary>
public HomeStatus CurrentStatus
{
get { return (HomeStatus)GetValue(CurrentStatusProperty); }
set { SetValue(CurrentStatusProperty, value); }
}
+ /// <summary>
+ /// Identifies the SelectedMenuName bindable property
+ /// </summary>
public static readonly BindableProperty SelectedMenuNameProperty = BindableProperty.Create("SelectedMenuName", typeof(HomeMenuItem), typeof(MainPage), default(HomeMenuItem));
+
+ /// <summary>
+ /// Gets or sets selected HomeMenuItem
+ /// </summary>
public HomeMenuItem SelectedMenuName
{
get { return (HomeMenuItem)GetValue(SelectedMenuNameProperty); }
set { SetValue(SelectedMenuNameProperty, value); }
}
+ /// <summary>
+ /// A list of SubPanels
+ /// </summary>
private Dictionary<HomeMenuItem, Panel> SubPanelDictionary;
+ /// <summary>
+ /// Iconifies the Home screen(Minimizes the Home screen)
+ /// </summary>
private async void Iconified()
{
#pragma warning disable CS4014
DependencyService.Get<IWindowAPIs>().SetIconified(true);
}
+ /// <summary>
+ /// Uniconifies the Home screen(Maximize the Home screen)
+ /// </summary>
private async void Uniconified()
{
#pragma warning disable CS4014
DependencyService.Get<IWindowAPIs>().SetIconified(false);
}
+ /// <summary>
+ /// Iconify/uniconify Home screen following current status
+ /// </summary>
private void ToggleIconified()
{
if (DependencyService.Get<IWindowAPIs>().GetIconified() == true)
}
}
+ /// <summary>
+ /// A constructor
+ /// Makes SubPanel list
+ /// Adds PropertyChanged event handler
+ /// Adds HomeKey and MenuKey event listener
+ /// </summary>
public MainPage()
{
InitializeComponent();
});
}
+ /// <summary>
+ /// This method is called when the properties of MainPage is changed
+ /// </summary>
+ /// <param name="sender">The source of event</param>
+ /// <param name="e">The event that is occurred when property is changed</param>
private void MainPage_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName.CompareTo("CurrentStatus") == 0)
}
}
+ /// <summary>
+ /// A method sets current status according to parameter
+ /// </summary>
+ /// <param name="status">The next status name</param>
private void SetCurrentStatus(HomeStatus status)
{
switch (status)
}
}
+ /// <summary>
+ /// A method sets selected HomeMenuItem according to parameter
+ /// </summary>
+ /// <param name="panelName">Selected HomeMenuItem</param>
private void SelectMenu(HomeMenuItem panelName)
{
foreach (var panelItem in SubPanelDictionary)
SubPanelDictionary[panelName].ShowPanel();
}
+ /// <summary>
+ /// A method unpins selected item according to parameter
+ /// </summary>
+ /// <param name="appId">Selected item's app ID</param>
private void UnpinAppShortcutInfo(string appId)
{
RemovePinnedApp(appId);
}
+ /// <summary>
+ /// A method updates the pinned app list according to parameter
+ /// </summary>
+ /// <param name="PinnedApps">A new pinned apps list</param>
private void UpdatePinnedApps(Dictionary<string, string> PinnedApps)
{
List<AppShortcutInfo> pinnedAppList = new List<AppShortcutInfo>();
TVHomeImpl.GetInstance.AppShortcutControllerInstance.UpdatePinnedApps(pinnedAppList);
}
+ /// <summary>
+ /// A method removes specific pinned app according to parameter
+ /// </summary>
+ /// <param name="AppID">To be removed app's app ID</param>
private async void RemovePinnedApp(string AppID)
{
Dictionary<string, string> PinnedApps = await TVHomeImpl.GetInstance.AppShortcutControllerInstance.GetPinnedAppsAppIDs();
}
}
+ /// <summary>
+ /// A task for handling BackKey event
+ /// </summary>
+ /// <returns>Always returns true</returns>
protected override bool OnBackButtonPressed()
{
ToggleIconified();
* limitations under the License.
*/
-using System;
-using System.Collections.Generic;
using System.ComponentModel;
-using System.Windows.Input;
using TVHome.Controls;
using LibTVRefCommonPortable.DataModels;
-using LibTVRefCommonPortable.Utils;
using TVHome.ViewModels;
using Xamarin.Forms;
using System.Threading.Tasks;
namespace TVHome.Views
{
/// <summary>
- /// Main Panel in Main Page
+ /// A MainPanel view in Main Page
/// </summary>
public partial class MainPanel : Panel
{
+ /// <summary>
+ /// Constructor
+ /// </summary>
public MainPanel()
{
InitializeComponent();
PropertyChanged += OnItemsSourcePropertyChanged;
}
+ /// <summary>
+ /// A event handler for handling property changed event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when property is changed</param>
private void OnItemsSourcePropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName != "ItemsSource")
PanelButtonGrid.ForceLayout();
}
+ /// <summary>
+ /// A method for initializing focus of MainPanel item
+ /// </summary>
public void InitialFocusing()
{
var button = PanelButtonGrid.Children[1];
button.FindByName<Button>("ButtonFocusArea").Focus();
}
+ /// <summary>
+ /// A method for translating when panel is focused
+ /// </summary>
public override async void FocusPanel()
{
await this.TranslateTo(0, 0, 300);
}
+ /// <summary>
+ /// A method for scaling panel when panel is hided
+ /// </summary>
public override async void HidePanel()
{
await this.ScaleTo(0, 0);
}
+ /// <summary>
+ /// A method for translating when panel is selected
+ /// </summary>
public async void SelectPanel()
{
await Task.Delay(300);
await this.TranslateTo(0, -78, 300);
}
+ /// <summary>
+ /// A method for scaling the panel when the panel is showed
+ /// </summary>
public override async void ShowPanel()
{
await this.ScaleTo(1, 0);
* limitations under the License.
*/
-using System;
using System.Collections.Generic;
-using System.ComponentModel;
using System.Windows.Input;
using LibTVRefCommonPortable.DataModels;
using Xamarin.Forms;
namespace TVHome.Views
{
+ /// <summary>
+ /// The Panel is a view for MainPanel and SubPanel of TV Home
+ /// </summary>
public abstract class Panel : ContentView
{
+ /// <summary>
+ /// Identifies the OnFocusedCommand bindable property
+ /// </summary>
public static readonly BindableProperty OnFocusedCommandProperty = BindableProperty.Create("OnFocusedCommand", typeof(ICommand), typeof(MainPanel));
+ /// <summary>
+ /// A command is executed when panel is focused
+ /// </summary>
public ICommand OnFocusedCommand
{
get { return (ICommand)GetValue(OnFocusedCommandProperty); }
set { SetValue(OnFocusedCommandProperty, value); }
}
+ /// <summary>
+ /// Identifies the OnUnpinCommand bindable property
+ /// </summary>
public static readonly BindableProperty OnUnpinCommandProperty = BindableProperty.Create("OnUnpinCommand", typeof(ICommand), typeof(SubPanel));
+ /// <summary>
+ /// A command is executed when item is unpinned
+ /// </summary>
public ICommand OnUnpinCommand
{
get { return (ICommand)GetValue(OnUnpinCommandProperty); }
set { SetValue(OnUnpinCommandProperty, value); }
}
+ /// <summary>
+ /// Identifies the ItemsSource bindable property
+ /// </summary>
public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create("ItemsSource", typeof(IEnumerable<ShortcutInfo>), typeof(MainPanel));
+ /// <summary>
+ /// Gets or set ItemSource to display item
+ /// </summary>
public IEnumerable<ShortcutInfo> ItemsSource
{
get { return (IEnumerable<ShortcutInfo>)GetValue(ItemsSourceProperty); }
set { SetValue(ItemsSourceProperty, value); }
}
+ /// <summary>
+ /// Identifies the ItemTemplate bindable property
+ /// </summary>
public static readonly BindableProperty ItemTemplateProperty = BindableProperty.Create("ItemTemplate", typeof(DataTemplate), typeof(SubPanel));
+ /// <summary>
+ /// Gets or set DataTemplate to display item
+ /// </summary>
public DataTemplate ItemTemplate
{
get { return (DataTemplate)GetValue(ItemTemplateProperty); }
set { SetValue(ItemTemplateProperty, value); }
}
+ /// <summary>
+ /// A flag indicates whether the panel is focused or not
+ /// </summary>
public bool isFocused;
+ /// <summary>
+ /// A method for handling panel focused event
+ /// </summary>
public abstract void FocusPanel();
+
+ /// <summary>
+ /// A method for handling to hide panel
+ /// </summary>
public abstract void HidePanel();
+
+ /// <summary>
+ /// A method for handling to show panel
+ /// </summary>
public abstract void ShowPanel();
}
}
* limitations under the License.
*/
-using System;
-using System.Collections.Generic;
-using System.Windows.Input;
using System.ComponentModel;
using TVHome.Controls;
using LibTVRefCommonPortable.DataModels;
-using TVHome.ViewModels;
using Xamarin.Forms;
-using LibTVRefCommonPortable.Utils;
using System.Threading.Tasks;
namespace TVHome.Views
/// </summary>
public partial class SubPanel : Panel
{
+ /// <summary>
+ /// A focused item in panel
+ /// </summary>
private ShortcutInfo focusedItem;
+
+ /// <summary>
+ /// Constructor
+ /// </summary>
public SubPanel()
{
InitializeComponent();
PropertyChanged += OnItemsSourcePropertyChanged;
}
+ /// <summary>
+ /// A method provides focused item in panel
+ /// </summary>
+ /// <returns>A focused item</returns>
public ShortcutInfo GetFocusedItem()
{
return focusedItem;
}
+ /// <summary>
+ /// A event handler for handling property changed event
+ /// </summary>
+ /// <param name="sender">A source of event</param>
+ /// <param name="e">The event that is occurred when property is changed</param>
private void OnItemsSourcePropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName != "ItemsSource")
}
+ /// <summary>
+ /// A method for hiding the panel
+ /// </summary>
public override async void HidePanel()
{
isFocused = false;
await this.FadeTo(0, 0);
}
+ /// <summary>
+ /// A method for showing the panel
+ /// </summary>
public override async void ShowPanel()
{
isFocused = false;
await this.FadeTo(0.3, 300);
}
+ /// <summary>
+ /// A method for handling panel focused event
+ /// </summary>
public override async void FocusPanel()
{
if (isFocused)
namespace TVHome.Views
{
/// <summary>
- /// Sub Panel in Main Page
+ /// SubThumnailPanel in Main Page for Recent
/// </summary>
public partial class SubThumbnailPanel : Panel
{
+ /// <summary>
+ /// Identifies the ShowNoContentsInfo bindable property
+ /// </summary>
public static readonly BindableProperty ShowNoContentsInfoProperty = BindableProperty.Create("ShowNoContentsInfo", typeof(bool), typeof(SubThumbnailPanel), default(bool));
+ /// <summary>
+ /// A flag indicates whether displaying "no content info" is needed or not
+ /// </summary>
public bool ShowNoContentsInfo
{
get { return (bool)GetValue(ShowNoContentsInfoProperty); }
set { SetValue(ShowNoContentsInfoProperty, value); }
}
+ /// <summary>
+ /// Constructor
+ /// </summary>
public SubThumbnailPanel()
{
InitializeComponent();
PropertyChanged += OnItemsSourcePropertyChanged;
}
+ /// <summary>
+ /// A event handler for handling property changed event
+ /// </summary>
+ /// <param name="sender">A source of event</param>
+ /// <param name="e">The event that is occurred when property is changed</param>
private void OnItemsSourcePropertyChanged(object sender, PropertyChangedEventArgs e)
{
if (e.PropertyName == "ShowNoContentsInfo")
HidePanel();
}
+ /// <summary>
+ /// A method for hiding the panel
+ /// </summary>
public override async void HidePanel()
{
if (NoContentInfo.IsVisible)
}
}
+ /// <summary>
+ /// A method for showing the panel
+ /// </summary>
public override async void ShowPanel()
{
if (NoContentInfo.IsVisible)
}
}
+ /// <summary>
+ /// A method for handling panel focused event
+ /// </summary>
public override async void FocusPanel()
{
if (isFocused)