public MainPage() { this.InitializeComponent(); // Set ourselves as the backend action listener App.BaconMan.SetBackendActionListner(this); // Set the title bar color ApplicationView.GetForCurrentView().TitleBar.BackgroundColor = Color.FromArgb(255, 51, 51, 51); ApplicationView.GetForCurrentView().TitleBar.ButtonBackgroundColor = Color.FromArgb(255, 51, 51, 51); ApplicationView.GetForCurrentView().TitleBar.InactiveBackgroundColor = Color.FromArgb(255, 51, 51, 51); ApplicationView.GetForCurrentView().TitleBar.ButtonInactiveBackgroundColor = Color.FromArgb(255, 51, 51, 51); ApplicationView.GetForCurrentView().TitleBar.ForegroundColor = Color.FromArgb(255, 255, 255, 255); ApplicationView.GetForCurrentView().TitleBar.InactiveForegroundColor = Color.FromArgb(255, 255, 255, 255); ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Color.FromArgb(255, 255, 255, 255); ApplicationView.GetForCurrentView().TitleBar.ButtonInactiveForegroundColor = Color.FromArgb(255, 255, 255, 255); // Create the starting panel WelcomePanel panel = new WelcomePanel(); // Create the panel manager m_panelManager = new PanelManager(this, (IPanel)panel); ui_contentRoot.Children.Add(m_panelManager); // Add transparency to the account header, this will make it darker Color accentColor = (ui_accountHeaderGrid.Background as SolidColorBrush).Color; accentColor.A = 200; ui_accountHeaderGrid.Background = new SolidColorBrush(accentColor); // Add some transparency to the subreddit header also. accentColor = (ui_accountHeaderGrid.Background as SolidColorBrush).Color; accentColor.A = 137; ui_trendingSubredditsHeader.Background = new SolidColorBrush(accentColor); // Add some transparency to the search header also. accentColor = (ui_accountHeaderGrid.Background as SolidColorBrush).Color; accentColor.A = 75; ui_searchHeader.Background = new SolidColorBrush(accentColor); // Sub to callbacks App.BaconMan.SubredditMan.OnSubredditsUpdated += SubredditMan_OnSubredditUpdate; App.BaconMan.UserMan.OnUserUpdated += UserMan_OnUserUpdated; // Sub to loaded Loaded += MainPage_Loaded; App.BaconMan.OnResuming += App_OnResuming; // Set the subreddit list ui_subredditList.ItemsSource = m_subreddits; }
public MainPage() { this.InitializeComponent(); // Set up the UI VisualStateManager.GoToState(this, "HideQuichSeachResults", false); // Set ourselves as the backend action listener App.BaconMan.SetBackendActionListner(this); // Set the title bar color ApplicationView.GetForCurrentView().TitleBar.BackgroundColor = Color.FromArgb(255, 51, 51, 51); ApplicationView.GetForCurrentView().TitleBar.ButtonBackgroundColor = Color.FromArgb(255, 51, 51, 51); ApplicationView.GetForCurrentView().TitleBar.InactiveBackgroundColor = Color.FromArgb(255, 51, 51, 51); ApplicationView.GetForCurrentView().TitleBar.ButtonInactiveBackgroundColor = Color.FromArgb(255, 51, 51, 51); ApplicationView.GetForCurrentView().TitleBar.ForegroundColor = Color.FromArgb(255, 255, 255, 255); ApplicationView.GetForCurrentView().TitleBar.InactiveForegroundColor = Color.FromArgb(255, 255, 255, 255); ApplicationView.GetForCurrentView().TitleBar.ButtonForegroundColor = Color.FromArgb(255, 255, 255, 255); ApplicationView.GetForCurrentView().TitleBar.ButtonInactiveForegroundColor = Color.FromArgb(255, 255, 255, 255); // Create the starting panel WelcomePanel panel = new WelcomePanel(); // Create the panel manager m_panelManager = new PanelManager(this, (IPanel)panel); ui_contentRoot.Children.Add(m_panelManager); App.BaconMan.OnBackButton += BaconMan_OnBackButton; // Sub to callbacks App.BaconMan.SubredditMan.OnSubredditsUpdated += SubredditMan_OnSubredditUpdate; App.BaconMan.UserMan.OnUserUpdated += UserMan_OnUserUpdated; // Sub to loaded Loaded += MainPage_Loaded; App.BaconMan.OnResuming += App_OnResuming; // Set the subreddit list ui_subredditList.ItemsSource = m_subreddits; // Setup the keyboard shortcut helper and sub. m_keyboardShortcutHepler = new KeyboardShortcutHelper(); m_keyboardShortcutHepler.OnQuickSearchActivation += KeyboardShortcutHepler_OnQuickSearchActivation; }