blob: 7f4e920eea377f0441dbea827ef07149fc12a1f9 [file] [log] [blame]
Nicolas Jagerbf406b22016-10-21 11:32:33 -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**************************************************************************/
atraczyk746f3762017-02-28 14:12:51 -050019
20#pragma once
21
Nicolas Jagerbf406b22016-10-21 11:32:33 -040022using namespace Platform;
23using namespace Windows::Data::Json;
24using namespace Windows::UI::Xaml;
25using namespace Windows::UI::Xaml::Data;
26
Nicolas Jager72b42922016-10-25 07:52:42 -040027#include <RingDebug.h>
28
Nicolas Jagerbf406b22016-10-21 11:32:33 -040029namespace RingClientUWP
30{
atraczyk746f3762017-02-28 14:12:51 -050031namespace Controls
32{
33
Nicolas Jagerbf406b22016-10-21 11:32:33 -040034public ref class AccountListItem sealed : public INotifyPropertyChanged
35{
36public:
37 AccountListItem(Account^ a);
38
atraczyk746f3762017-02-28 14:12:51 -050039 void raiseNotifyPropertyChanged(String^ propertyName);
Nicolas Jagerbf406b22016-10-21 11:32:33 -040040 virtual event PropertyChangedEventHandler^ PropertyChanged;
atraczyk746f3762017-02-28 14:12:51 -050041
Nicolas Jagerbf406b22016-10-21 11:32:33 -040042 property Account^ _account;
atraczyk746f3762017-02-28 14:12:51 -050043
44 property bool _editionMode;
45 property bool _disconnected;
46
Nicolas Jagerbf406b22016-10-21 11:32:33 -040047 property bool _isSelected {
atraczyk746f3762017-02-28 14:12:51 -050048 bool get() {
49 return isSelected_;
50 }
Nicolas Jagerbf406b22016-10-21 11:32:33 -040051 void set(bool value) {
52 isSelected_ = value;
Nicolas Jager5a197d52016-10-25 11:24:03 -040053 if (!_disconnected)
54 NotifyPropertyChanged("_isSelected");
Nicolas Jagerbf406b22016-10-21 11:32:33 -040055 }
Nicolas Jagerbf406b22016-10-21 11:32:33 -040056 }
Nicolas Jagerbf406b22016-10-21 11:32:33 -040057
58protected:
59 void NotifyPropertyChanged(String^ propertyName);
60
61private:
62 bool isSelected_;
Nicolas Jagerbf406b22016-10-21 11:32:33 -040063};
64}
65}
66