blob: c89f42329b27fd3a6d3ce916b1dafcd5d5b366cf [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
20#include "MainPage.xaml.h"
21
22using namespace Windows::ApplicationModel::Core;
23using namespace Windows::Foundation;
24using namespace Windows::Graphics::Display;
Nicolas Jager15861202016-08-12 11:13:05 -040025using namespace Windows::UI;
Nicolas Jager998fbd72016-08-08 11:41:28 -040026using namespace Windows::UI::Xaml;
27using namespace Windows::UI::Xaml::Controls;
28using namespace Windows::UI::Xaml::Interop;
Nicolas Jager15861202016-08-12 11:13:05 -040029using namespace Windows::UI::Xaml::Media;
Nicolas Jager998fbd72016-08-08 11:41:28 -040030using namespace Windows::UI::ViewManagement;
31
32using namespace RingClientUWP;
33
34App::App()
35{
36 InitializeComponent(); // summon partial class, form generated files trough App.xaml
37}
38
39void
40App::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 Jager15861202016-08-12 11:13:05 -040054
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 Jager998fbd72016-08-08 11:41:28 -040061}