--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<ViewCell xmlns="http://xamarin.com/schemas/2014/forms"
+ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
+ x:Class="TVHome.Controls.SubPanelThumbnailButton">
+ <RelativeLayout Opacity="0.3">
+ <BoxView x:Name = "ButtonBox"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"
+ Color="Blue" />
+ <Image x:Name="ButtonImage"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"
+ Source="{Binding CurrentStateDescription.IconPath}" />
+ <Image x:Name="ButtonIcon"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonImage, Property=Height, Factor=0.4}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonImage, Property=Width, Factor=0.4}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonImage, Property=Height, Factor=0.6}"
+ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToView, ElementName=ButtonImage, Property=Width, Factor=0.6}"
+ Source="AppIcon.png" />
+ <Label x:Name="ButtonTitle"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.2}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"
+ RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.8}"
+ Opacity="0"
+ LineBreakMode="TailTruncation"
+ HorizontalTextAlignment="Center"
+ Text="{Binding CurrentStateDescription.Label}" />
+ <Button x:Name = "ButtonFocusArea"
+ RelativeLayout.HeightConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=1}"
+ RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Height, Factor=0.94}"
+ Focused="OnFocused"
+ Unfocused="OnUnfocused"
+ Clicked="OnClicked"
+ Opacity="0" />
+ </RelativeLayout>
+</ViewCell>
\ No newline at end of file
--- /dev/null
+/*
+ * 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.
+ */
+
+using System;
+using System.Windows.Input;
+using TVHome.Utils;
+using Xamarin.Forms;
+
+namespace TVHome.Controls
+{
+ /// <summary>
+ /// Custom Control for Thumbnail Button in Sub Panel
+ /// </summary>
+ public partial class SubPanelThumbnailButton : ViewCell
+ {
+ public BindableProperty OnFocusedCommandProperty = BindableProperty.Create("OnFocusedCommand", typeof(ICommand), typeof(SubPanelButton));
+
+ public ICommand OnFocusedCommand
+ {
+ get { return (ICommand)GetValue(OnFocusedCommandProperty); }
+ set { SetValue(OnFocusedCommandProperty, value); }
+ }
+
+ public BindableProperty OnClickedCommandProperty = BindableProperty.Create("OnClickedCommand", typeof(ICommand), typeof(SubPanelButton));
+
+ public ICommand OnClickedCommand
+ {
+ get { return (ICommand)GetValue(OnClickedCommandProperty); }
+ set { SetValue(OnClickedCommandProperty, value); }
+ }
+
+ public SubPanelThumbnailButton()
+ {
+ InitializeComponent();
+ }
+
+ private async void OnFocused(object sender, FocusEventArgs e)
+ {
+ if (OnFocusedCommand != null)
+ {
+ OnFocusedCommand.Execute("");
+ }
+
+ ButtonTitle.FadeTo(0.99, 300);
+ await View.FadeTo(0.6, 300);
+ }
+
+ private async void OnUnfocused(object sender, FocusEventArgs e)
+ {
+ ButtonTitle.FadeTo(0, 300);
+ await View.FadeTo(0.3, 300);
+ }
+
+ private async void OnClicked(object sender, EventArgs e)
+ {
+ if (OnClickedCommand != null)
+ {
+ OnClickedCommand.Execute("");
+ }
+
+ await View.FadeTo(0.9, 300);
+ }
+ }
+}
\ No newline at end of file