blob: ebf3eee9dac14f19d3ffe19270ee0b9bb6ac57ff [file] [log] [blame]
Nicolas Jager7c409f32016-09-08 09:35:16 -04001/**************************************************************************
2* Copyright (C) 2016 by Savoir-faire Linux *
3* Author: Jäger Nicolas <nicolas.jager@savoirfairelinux.com> *
4* Author: Traczyk Andreas <traczyk.andreas@savoirfairelinux.com> *
5* *
6* This program is free software; you can redistribute it and/or modify *
7* it under the terms of the GNU General Public License as published by *
8* the Free Software Foundation; either version 3 of the License, or *
9* (at your option) any later version. *
10* *
11* This program is distributed in the hope that it will be useful, *
12* but WITHOUT ANY WARRANTY; without even the implied warranty of *
13* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14* GNU General Public License for more details. *
15* *
16* You should have received a copy of the GNU General Public License *
17* along with this program. If not, see <http://www.gnu.org/licenses/>. *
18**************************************************************************/
19#include "pch.h"
20
21#include "SmartPanelItem.h"
22
23using namespace Windows::ApplicationModel::Core;
24using namespace Platform;
25using namespace Windows::Data::Json;
26using namespace Windows::UI::Core;
27
28using namespace RingClientUWP;
29using namespace RingClientUWP::Controls;
30using namespace ViewModel;
31
32SmartPanelItem::SmartPanelItem()
Nicolas Jagerc551c362016-10-01 19:24:50 -040033{
Nicolas Jager9edbea32016-10-03 09:13:53 -040034 _callId = "";
35
Nicolas Jager083b3ae2016-10-04 08:46:19 -040036 RingD::instance->callPlaced += ref new RingClientUWP::CallPlaced(this, &RingClientUWP::Controls::SmartPanelItem::OncallPlaced);
Nicolas Jagerc551c362016-10-01 19:24:50 -040037}
Nicolas Jager7c409f32016-09-08 09:35:16 -040038
39void
40SmartPanelItem::NotifyPropertyChanged(String^ propertyName)
41{
42 CoreApplicationView^ view = CoreApplication::MainView;
43 view->CoreWindow->Dispatcher->RunAsync(
Nicolas Jager9edbea32016-10-03 09:13:53 -040044 CoreDispatcherPriority::High,
Nicolas Jager7c409f32016-09-08 09:35:16 -040045 ref new DispatchedHandler([this, propertyName]()
46 {
47 PropertyChanged(this, ref new PropertyChangedEventArgs(propertyName));
48 }));
Nicolas Jager083b3ae2016-10-04 08:46:19 -040049}
50
51void RingClientUWP::Controls::SmartPanelItem::OncallPlaced(Platform::String ^callId)
52{
53 if (_callId == callId) {
54 _callStatus = CallStatus::SEARCHING;
55 }
56}