break;
}
});
+ PageMainPanel.OnItemSelectedHandler += (id) => {
+ DebuggingUtils.Dbg("Selected Item " + id);
+ switch (id)
+ {
+ case HomeMenuItem.Recent:
+ RecentSubPanel.FocusPanel();
+ AppsSubPanel.HidePanel();
+ SettingsSubPanel.HidePanel();
+ break;
+ case HomeMenuItem.Apps:
+ RecentSubPanel.HidePanel();
+ AppsSubPanel.FocusPanel();
+ SettingsSubPanel.HidePanel();
+ break;
+ case HomeMenuItem.Settings:
+ RecentSubPanel.HidePanel();
+ AppsSubPanel.HidePanel();
+ SettingsSubPanel.FocusPanel();
+ break;
+ }
+ };
}
protected override void OnAppearing()
{
AppsSubPanel.ChangeToDefaultMode();
}
+ else if (AppsSubPanel.isFocused)
+ {
+ PageMainPanel.SetButtonFocus(1);
+ }
+ else if (RecentSubPanel.isFocused)
+ {
+ PageMainPanel.SetButtonFocus(0);
+ }
+ else if (SettingsSubPanel.isFocused)
+ {
+ PageMainPanel.SetButtonFocus(2);
+ }
else
{
ToggleIconified();
/// </summary>
public partial class MainPanel : Panel
{
+ public delegate void SelectEventHandler(HomeMenuItem item);
+ public SelectEventHandler OnItemSelectedHandler;
/// <summary>
/// MainPanel icon's transition height value when it focused.
/// </summary>
});
button.OnClickedCommand = new Command(() =>
{
- item.DoAction();
+ OnItemSelectedHandler?.Invoke(ItemName);
+ //item.DoAction();
});
PanelButtonGrid.Children.Add(button.View, index, 0);
{
await this.ScaleTo(1, 0);
}
+ public void SetButtonFocus(int idx)
+ {
+ var button = PanelButtonGrid.Children[idx];
+ button.FindByName<Button>("ButtonFocusArea").Focus();
+ }
}
}
\ No newline at end of file