From: Heonjae Jang Date: Fri, 3 Mar 2017 07:46:15 +0000 (+0900) Subject: Change Panel and Panel Buttons X-Git-Tag: submit/tizen/20170808.015446~222 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e3463be4e590be995d77d8ff83be8f5da40faf5;p=profile%2Ftv%2Fapps%2Fdotnet%2Fhome.git Change Panel and Panel Buttons 1. Create Abstract Class "Panel" 2. ~Panel Generalize Panel 3. Change Animation Panel, Panel Buttons Change-Id: I48d3ebbf9b9ba44699bed2fc511e889a8df4e368 --- diff --git a/TVHome/TVHome/Controls/SubPanelButton.xaml b/TVHome/TVHome/Controls/SubPanelButton.xaml index 5da7f34..d238c9d 100644 --- a/TVHome/TVHome/Controls/SubPanelButton.xaml +++ b/TVHome/TVHome/Controls/SubPanelButton.xaml @@ -3,7 +3,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:Controls="clr-namespace:TVHome.Controls" x:Class="TVHome.Controls.SubPanelButton"> - + MainPanel.xaml + SubPanel.xaml + + SubThumbnailPanel.xaml + @@ -152,6 +156,12 @@ Designer + + + MSBuild:UpdateDesignTimeXaml + Designer + + diff --git a/TVHome/TVHome/Views/MainPage.xaml b/TVHome/TVHome/Views/MainPage.xaml index 5415809..9f4169e 100755 --- a/TVHome/TVHome/Views/MainPage.xaml +++ b/TVHome/TVHome/Views/MainPage.xaml @@ -30,22 +30,22 @@ RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Factor=0.390625}" ItemsSource="{Binding MainList}"/> - - + - - + + @@ -55,9 +55,9 @@ diff --git a/TVHome/TVHome/Views/MainPage.xaml.cs b/TVHome/TVHome/Views/MainPage.xaml.cs index 45ff941..6747528 100644 --- a/TVHome/TVHome/Views/MainPage.xaml.cs +++ b/TVHome/TVHome/Views/MainPage.xaml.cs @@ -31,17 +31,18 @@ namespace TVHome.Views public partial class MainPage : ContentPage { - private Dictionary SubPanelDictionary; - private SubPanel currentSubPanel; + private Dictionary SubPanelDictionary; + private Panel currentSubPanel; public ICommand ChangeSubPanelCommand; public MainPage() { InitializeComponent(); - SubPanelDictionary = new Dictionary(); + SubPanelDictionary = new Dictionary(); SubPanelDictionary.Add("Recent", RecentSubPanel); SubPanelDictionary.Add("Apps", AppsSubPanel); SubPanelDictionary.Add("Settings", SettingsSubPanel); + PageMainPanel.OnFocusedCommand = new Command((key) => { DebuggingUtils.Dbg("MainPage : " + key); @@ -53,6 +54,21 @@ namespace TVHome.Views currentSubPanel = SubPanelDictionary[key]; currentSubPanel.ShowPanel(); }); + + RecentSubPanel.OnFocusedCommand = new Command(() => + { + PageMainPanel.SelectPanel(); + }); + + AppsSubPanel.OnFocusedCommand = new Command(() => + { + PageMainPanel.SelectPanel(); + }); + + SettingsSubPanel.OnFocusedCommand = new Command(() => + { + PageMainPanel.SelectPanel(); + }); } private void OnAppearing(object sender, EventArgs e) diff --git a/TVHome/TVHome/Views/MainPanel.xaml b/TVHome/TVHome/Views/MainPanel.xaml index 096191c..b881fff 100644 --- a/TVHome/TVHome/Views/MainPanel.xaml +++ b/TVHome/TVHome/Views/MainPanel.xaml @@ -1,14 +1,13 @@  - - - - - - - - - - - \ No newline at end of file + + + + + + + + \ No newline at end of file diff --git a/TVHome/TVHome/Views/MainPanel.xaml.cs b/TVHome/TVHome/Views/MainPanel.xaml.cs index e4ff6ad..527e92e 100644 --- a/TVHome/TVHome/Views/MainPanel.xaml.cs +++ b/TVHome/TVHome/Views/MainPanel.xaml.cs @@ -29,24 +29,8 @@ namespace TVHome.Views /// /// Main Panel in Main Page /// - public partial class MainPanel : ContentView + public partial class MainPanel : Panel { - public static readonly BindableProperty ItemsSourceProperty = BindableProperty.Create("ItemsSource", typeof(IEnumerable), typeof(MainPanel)); - - public IEnumerable ItemsSource - { - get { return (IEnumerable)GetValue(ItemsSourceProperty); } - set { SetValue(ItemsSourceProperty, value); } - } - - public static readonly BindableProperty OnFocusedCommandProperty = BindableProperty.Create("OnFocusedCommand", typeof(ICommand), typeof(MainPanel)); - - public ICommand OnFocusedCommand - { - get { return (ICommand)GetValue(OnFocusedCommandProperty); } - set { SetValue(OnFocusedCommandProperty, value); } - } - public MainPanel() { InitializeComponent(); @@ -68,6 +52,7 @@ namespace TVHome.Views button.View.BindingContext = item; button.OnFocusedCommand = new Command(() => { + FocusPanel(); OnFocusedCommand.Execute(item.StateDescriptions["default"].Label); }); button.OnClickedCommand = new Command(() => @@ -80,8 +65,28 @@ namespace TVHome.Views public void InitialFocusing() { - var button = PanelButtonGrid.Children[1] as RelativeLayout; + var button = PanelButtonGrid.Children[1]; button.FindByName