blob: 7239a55690bce11df7e47303ec00fce751b37381 [file] [log] [blame]
Nicolas Jager998fbd72016-08-08 11:41:28 -04001/**************************************************************************
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
atraczyk61b28422016-08-24 09:25:59 -040020#include "LoadingPage.xaml.h"
Nicolas Jager998fbd72016-08-08 11:41:28 -040021#include "MainPage.xaml.h"
22
23using namespace Windows::ApplicationModel::Core;
24using namespace Windows::Foundation;
25using namespace Windows::Graphics::Display;
Nicolas Jager15861202016-08-12 11:13:05 -040026using namespace Windows::UI;
Nicolas Jager998fbd72016-08-08 11:41:28 -040027using namespace Windows::UI::Xaml;
28using namespace Windows::UI::Xaml::Controls;
29using namespace Windows::UI::Xaml::Interop;
Nicolas Jager15861202016-08-12 11:13:05 -040030using namespace Windows::UI::Xaml::Media;
Nicolas Jager998fbd72016-08-08 11:41:28 -040031using namespace Windows::UI::ViewManagement;
32
33using namespace RingClientUWP;
34
35App::App()
36{
37 InitializeComponent(); // summon partial class, form generated files trough App.xaml
38}
39
40void
41App::OnLaunched(LaunchActivatedEventArgs^ e)
42{
43 rootFrame = dynamic_cast<Frame^>(Window::Current->Content);
44
45 if (rootFrame == nullptr) {
46 rootFrame = ref new Frame();
47
48 if (rootFrame->Content == nullptr)
atraczyk61b28422016-08-24 09:25:59 -040049 rootFrame->Navigate(TypeName(Views::LoadingPage::typeid), e->Arguments);
Nicolas Jager998fbd72016-08-08 11:41:28 -040050
51 Window::Current->Content = rootFrame;
52 Window::Current->Activate();
53 } else
atraczyk61b28422016-08-24 09:25:59 -040054 rootFrame->Navigate(TypeName(Views::LoadingPage::typeid), e->Arguments);
Nicolas Jager15861202016-08-12 11:13:05 -040055
Nicolas Jager15861202016-08-12 11:13:05 -040056 ApplicationView::GetForCurrentView()->TitleBar->ButtonBackgroundColor = Colors::LightBlue;
atraczyk0cf42d72016-09-06 11:16:37 -040057 ApplicationView::GetForCurrentView()->TitleBar->InactiveBackgroundColor = Colors::LightBlue;
Nicolas Jager15861202016-08-12 11:13:05 -040058 ApplicationView::GetForCurrentView()->TitleBar->ButtonInactiveBackgroundColor = Colors::LightBlue;
atraczyk0cf42d72016-09-06 11:16:37 -040059 ApplicationView::GetForCurrentView()->TitleBar->BackgroundColor = Colors::LightBlue;
Nicolas Jager15861202016-08-12 11:13:05 -040060 ApplicationView::GetForCurrentView()->TitleBar->ForegroundColor = Colors::White;
61 ApplicationView::GetForCurrentView()->TitleBar->ButtonForegroundColor = Colors::White;
Nicolas Jager998fbd72016-08-08 11:41:28 -040062}