Example #1
0
        public void GoLoginPage(object sender, EventArgs args)
        {
            this.ToolbarItems.Clear();

            if (Client.CurrentClient != null)
            {
                Client.LoginOut();
            }
            ClientPage = null;
            GetLoginPage();
        }
Example #2
0
        public void GetClientPage()
        {
            Title = "Профиль " + Client.CurrentClient.Name;

            LoginPage       = null;
            RegisrationPage = null;

            ClientPage = new ClientControls();
            ClientPage.LoginOutBtn.Clicked += GoLoginPage;

            StackLayout stackLayout = new StackLayout();

            stackLayout.Margin = 20;

            stackLayout.Children.Add(ClientPage.NameLab);
            stackLayout.Children.Add(ClientPage.LoginLab);
            stackLayout.Children.Add(ClientPage.NoteCount);

            // заметки пользователя
            foreach (var note in Client.CurrentClient.Notes)
            {
                stackLayout.Children.Add(PaintNote(note));
            }

            stackLayout.Children.Add(ClientPage.LoginOutBtn);

            this.Content = new ScrollView {
                Content = stackLayout
            };

            #region ToolBarItems

            this.ToolbarItems.Clear();

            ToolbarItem NewNote = new ToolbarItem
            {
                Text     = "Новая заметка",
                Order    = ToolbarItemOrder.Secondary,
                Priority = 0,
            };
            ToolbarItem FavRoom = new ToolbarItem
            {
                Text     = "Избранное",
                Order    = ToolbarItemOrder.Secondary,
                Priority = 1,
            };
            ToolbarItem LogOut = new ToolbarItem
            {
                Text     = "Выйти",
                Order    = ToolbarItemOrder.Secondary,
                Priority = 1,
            };

            NewNote.Clicked += OnNewNoteClicked;
            FavRoom.Clicked += OnFavRoomsClicked;
            LogOut.Clicked  += GoLoginPage;

            this.ToolbarItems.Add(NewNote);
            this.ToolbarItems.Add(FavRoom);
            this.ToolbarItems.Add(LogOut);

            #endregion
        }
 public abstract Keys GetKeyForAction(ClientControls action);