/// </summary>
public partial class MainPanelButton : PanelButton
{
+ /// <summary>
+ /// The property for checking button's status
+ /// </summary>
public static readonly BindableProperty StatusProperty = BindableProperty.Create("Status", typeof(string), typeof(PanelButton), default(string));
public string Status
set { SetValue(StatusProperty, value); }
}
+ /// <summary>
+ /// The constructor of this class
+ /// </summary>
public MainPanelButton()
{
InitializeComponent();
PropertyChanged += MainPanelButton_PropertyChanged;
}
+ /// <summary>
+ /// Handles MainPanelButton Property Changed event
+ /// Runs animation according to property change of MainPanelButton
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when property of MainPanelButton is changed</param>
private void MainPanelButton_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
if (e.PropertyName.CompareTo("Status") == 0)
}
}
+ /// <summary>
+ /// Handles Button Focused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is focused</param>
public override void OnFocused(object sender, FocusEventArgs e)
{
if (OnFocusedCommand != null)
}
}
+ /// <summary>
+ /// Handles Button Unfocused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is unfocused</param>
public override void OnUnfocused(object sender, FocusEventArgs e)
{
}
+ /// <summary>
+ /// Handles Button Clicked event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is clicked</param>
public override void OnClicked(object sender, EventArgs e)
{
if (OnClickedCommand != null)
namespace TVHome.Controls
{
+ /// <summary>
+ /// TVHome has two panels, MainPanel and SubPanel. The panels have several panel buttons.
+ /// The class for handling panel button's events
+ /// </summary>
public abstract class PanelButton : ViewCell
{
-
+ /// <summary>
+ /// A Command will be executed the button is focused.
+ /// </summary>
public ICommand OnFocusedCommand { get; set; }
+ /// <summary>
+ /// A Command will be executed the button is clicked.
+ /// </summary>
public ICommand OnClickedCommand { get; set; }
+ /// <summary>
+ /// Handles Button Focused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is focused</param>
public abstract void OnFocused(object sender, FocusEventArgs e);
+ /// <summary>
+ /// Handles Button Unfocused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is unfocused</param>
public abstract void OnUnfocused(object sender, FocusEventArgs e);
+ /// <summary>
+ /// Handles Button Clicked event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is clicked</param>
public abstract void OnClicked(object sender, EventArgs e);
}
}
*/
using System;
-
using LibTVRefCommonPortable.Utils;
-
using Xamarin.Forms;
namespace TVHome.Controls
{
/// <summary>
- /// haha
+ /// Custom Control for Button in Sub Panel
/// </summary>
public partial class SubPanelAllAppsButton : PanelButton
{
+ /// <summary>
+ /// Constructor
+ /// </summary>
public SubPanelAllAppsButton()
{
InitializeComponent();
}
+ /// <summary>
+ /// Handles Button Clicked event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is clicked</param>
public override async void OnClicked(object sender, EventArgs e)
{
if (OnClickedCommand != null)
await View.FadeTo(0.99, 300);
}
+ /// <summary>
+ /// Handles Button Focused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is focused</param>
public override async void OnFocused(object sender, FocusEventArgs e)
{
if (OnFocusedCommand != null)
/// </summary>
public partial class SubPanelButton : PanelButton
{
+ /// <summary>
+ /// Constructor
+ /// </summary>
public SubPanelButton()
{
InitializeComponent();
}
+ /// <summary>
+ /// Handles Button Clicked event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is clicked</param>
public override async void OnClicked(object sender, EventArgs e)
{
if (OnClickedCommand != null)
await View.FadeTo(0.99, 300);
}
+ /// <summary>
+ /// Handles Button Focused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is focused</param>
public override async void OnFocused(object sender, FocusEventArgs e)
{
if (OnFocusedCommand != null)
await ButtonImage.ScaleTo(1.3, 300);
}
+ /// <summary>
+ /// Handles Button Unfocused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is unfocused</param>
public override async void OnUnfocused(object sender, FocusEventArgs e)
{
#pragma warning disable CS4014
/// </summary>
public partial class SubPanelReservedButton : PanelButton
{
+ /// <summary>
+ /// Constructor
+ /// </summary>
public SubPanelReservedButton()
{
InitializeComponent();
}
+ /// <summary>
+ /// Handles Button Clicked event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is clicked</param>
public override async void OnClicked(object sender, EventArgs e)
{
if (OnClickedCommand != null)
await View.FadeTo(0.99, 300);
}
+ /// <summary>
+ /// Handles Button Focused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is focused</param>
public override async void OnFocused(object sender, FocusEventArgs e)
{
if (OnFocusedCommand != null)
await ButtonBgImage.ScaleTo(1.3, 300);
}
+ /// <summary>
+ /// Handles Button Unfocused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is unfocused</param>
public override async void OnUnfocused(object sender, FocusEventArgs e)
{
#pragma warning disable CS4014
/// </summary>
public partial class SubPanelThumbnailButton : PanelButton
{
+ /// <summary>
+ /// Constructor
+ /// </summary>
public SubPanelThumbnailButton()
{
InitializeComponent();
{
}
+ /// <summary>
+ /// Handles Button Clicked event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is clicked</param>
public override async void OnClicked(object sender, EventArgs e)
{
if (OnClickedCommand != null)
await View.FadeTo(0.9, 300);
}
+ /// <summary>
+ /// Handles Button Focused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is focused</param>
public override async void OnFocused(object sender, FocusEventArgs e)
{
if (OnFocusedCommand != null)
await View.ScaleTo(1.11, 300);
}
+ /// <summary>
+ /// Handles Button Unfocused event
+ /// </summary>
+ /// <param name="sender">The source of the event</param>
+ /// <param name="e">The event that is occurred when button is unfocused</param>
public override async void OnUnfocused(object sender, FocusEventArgs e)
{
// Height, Width 확장 Animiation