Nicolas Jager | 998fbd7 | 2016-08-08 11:41:28 -0400 | [diff] [blame] | 1 | /**************************************************************************
|
| 2 | * Copyright (C) 2016 by Savoir-faire Linux *
|
| 3 | * Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
|
| 4 | * *
|
| 5 | * This program is free software; you can redistribute it and/or modify *
|
| 6 | * it under the terms of the GNU General Public License as published by *
|
| 7 | * the Free Software Foundation; either version 3 of the License, or *
|
| 8 | * (at your option) any later version. *
|
| 9 | * *
|
| 10 | * This program is distributed in the hope that it will be useful, *
|
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
| 13 | * GNU General Public License for more details. *
|
| 14 | * *
|
| 15 | * You should have received a copy of the GNU General Public License *
|
| 16 | * along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
| 17 | **************************************************************************/
|
| 18 | #include "pch.h"
|
| 19 |
|
| 20 | #include "MainPage.xaml.h"
|
| 21 |
|
| 22 | using namespace Windows::ApplicationModel::Core;
|
| 23 | using namespace Windows::Foundation;
|
| 24 | using namespace Windows::Graphics::Display;
|
Nicolas Jager | 1586120 | 2016-08-12 11:13:05 -0400 | [diff] [blame] | 25 | using namespace Windows::UI;
|
Nicolas Jager | 998fbd7 | 2016-08-08 11:41:28 -0400 | [diff] [blame] | 26 | using namespace Windows::UI::Xaml;
|
| 27 | using namespace Windows::UI::Xaml::Controls;
|
| 28 | using namespace Windows::UI::Xaml::Interop;
|
Nicolas Jager | 1586120 | 2016-08-12 11:13:05 -0400 | [diff] [blame] | 29 | using namespace Windows::UI::Xaml::Media;
|
Nicolas Jager | 998fbd7 | 2016-08-08 11:41:28 -0400 | [diff] [blame] | 30 | using namespace Windows::UI::ViewManagement;
|
| 31 |
|
| 32 | using namespace RingClientUWP;
|
| 33 |
|
| 34 | App::App()
|
| 35 | {
|
| 36 | InitializeComponent(); // summon partial class, form generated files trough App.xaml
|
| 37 | }
|
| 38 |
|
| 39 | void
|
| 40 | App::OnLaunched(LaunchActivatedEventArgs^ e)
|
| 41 | {
|
| 42 | rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
|
| 43 |
|
| 44 | if (rootFrame == nullptr) {
|
| 45 | rootFrame = ref new Frame();
|
| 46 |
|
| 47 | if (rootFrame->Content == nullptr)
|
| 48 | rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
|
| 49 |
|
| 50 | Window::Current->Content = rootFrame;
|
| 51 | Window::Current->Activate();
|
| 52 | } else
|
| 53 | rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
|
Nicolas Jager | 1586120 | 2016-08-12 11:13:05 -0400 | [diff] [blame] | 54 |
|
| 55 | CoreApplication::GetCurrentView()->TitleBar->ExtendViewIntoTitleBar = true;
|
| 56 | ApplicationView::GetForCurrentView()->TitleBar->ButtonBackgroundColor = Colors::LightBlue;
|
| 57 | ApplicationView::GetForCurrentView()->TitleBar->ButtonInactiveBackgroundColor = Colors::LightBlue;
|
| 58 | ApplicationView::GetForCurrentView()->TitleBar->ForegroundColor = Colors::White;
|
| 59 | ApplicationView::GetForCurrentView()->TitleBar->ButtonForegroundColor = Colors::White;
|
| 60 |
|
Nicolas Jager | 998fbd7 | 2016-08-08 11:41:28 -0400 | [diff] [blame] | 61 | } |