void OnSearchClear()
        {
            previousPattern          = string.Empty;
            CurrentModel             = AppModel.Instance.CurrentConnectionsWrapper;
            UserListView.ItemsSource = CurrentModel;

            _wrapper.ClearSearch();
        }
Esempio n. 2
0
        public void Search(ConnectionsDataWrapper dataWrapper, string pattern)
        {
            IsBusy = false;

            IsSearching       = true;
            Pattern           = pattern;
            SearchDataWrapper = dataWrapper;
            OnAction();
        }
Esempio n. 3
0
        private void ApplyUser(UserModel newUserModel)
        {
            CurrentUser = newUserModel;

            if (CurrentUser != null)
            {
                InitUserModel(CurrentUser);
                CurrentConnectionsWrapper = new ConnectionsDataWrapper(CurrentUser, UsersModelsWrapper);
                CurrentContactListWrapper = new ContactListWrapper(CurrentUser, CurrentConnectionsWrapper);
            }
        }
Esempio n. 4
0
        private ConnectionsDataWrapper GetPendingConnectionsDataWrapper()
        {
            ConnectionsDataWrapper PendingConnectionsDataWrapper = new ConnectionsDataWrapper();

            for (int i = 0; i < CurrentModel.Count; i++)
            {
                if (CurrentModel[i].State == ConnectState.RequestedToAccept)
                {
                    PendingConnectionsDataWrapper.Add(CurrentModel[i]);
                }
            }
            return(PendingConnectionsDataWrapper);
        }
Esempio n. 5
0
        void OnSearch(string pattern)
        {
            if (_previousPattern.Equals(pattern))
            {
                return;
            }

            _previousPattern = pattern;

            CurrentDataWrapper = new ConnectionsDataWrapper(AppModel.Instance.CurrentUser,
                                                            new DynamicListData <User>(), AppModel.Instance.UsersModelsWrapper);
            _gridView.ItemsSource = CurrentDataWrapper;

            AppController.Instance.SearchUsers(CurrentDataWrapper.SearchUsers, _previousPattern, null);
        }
Esempio n. 6
0
        private void OnSearch(string pattern)
        {
            if (previousPattern.Equals(pattern))
            {
                return;
            }

            previousPattern = pattern;
            CurrentModel    = new ConnectionsDataWrapper(AppModel.Instance.CurrentUser,
                                                         new DynamicListData <User>(), AppModel.Instance.UsersModelsWrapper);

            UserListView.ItemsSource = CurrentModel;

            _wrapper.Search(CurrentModel, previousPattern);
        }
Esempio n. 7
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            DefaultDataWrapper = AppModel.Instance.CurrentConnectionsWrapper;
            CurrentDataWrapper = DefaultDataWrapper;

            var searchBarView = new SearchBarView();

            searchBarView.Clear  += OnSearchClear;
            searchBarView.Search += OnSearch;

            int width = AppProvider.Screen.ConvertPixelsToDp(AppProvider.Screen.Width) - 20;

            _gridView = new GridView {
                RowSpacing           = 5,
                ColumnSpacing        = 5,
                ContentPaddingBottom = 0,
                ContentPaddingTop    = 0,
                ContentPaddingLeft   = 0,
                ContentPaddingRight  = 0,
                ItemWidth            = width,
                ItemHeight           = 60,
                ItemsSource          = CurrentDataWrapper,
                ItemTemplate         = new DataTemplate(typeof(ConnectionFastCell))
            };

            var container = new PageViewContainer {
                HorizontalOptions = LayoutOptions.StartAndExpand,
                VerticalOptions   = LayoutOptions.FillAndExpand,
                Content           = new ContentPage {
                    Content = _gridView
                }
            };

            Content = new StackLayout {
                Orientation = StackOrientation.Vertical,
                Children    =
                {
                    new UserHeaderView(CurrentDataWrapper.LoginedUser, false),
                    searchBarView,
                    container
                }
            };

            AppController.Instance.DownloadAllUsers(null);
            UserController.Instance.UpdateProfileData(AppModel.Instance.CurrentUser, true);
        }
Esempio n. 8
0
        public void LogoutUser()
        {
            if (CurrentConnectionsWrapper != null)
            {
                CurrentConnectionsWrapper.ClearData();
            }
            CurrentConnectionsWrapper = null;

            if (CurrentContactListWrapper != null)
            {
                CurrentContactListWrapper.ClearData();
            }
            CurrentContactListWrapper = null;

            ChangeUser(null);
        }
Esempio n. 9
0
 void OnSearchClear()
 {
     _previousPattern      = string.Empty;
     CurrentDataWrapper    = DefaultDataWrapper;
     _gridView.ItemsSource = CurrentDataWrapper;
 }
Esempio n. 10
0
 public ConnectListWrapper(ConnectionsDataWrapper currentModel)
 {
     CurrentModel = currentModel;
 }
Esempio n. 11
0
        public ConnectionPage()
        {
            Title           = AppResources.Connect;
            BackgroundColor = Color.Transparent;

            CurrentModel = AppModel.Instance.CurrentConnectionsWrapper;
            PendingConnectionsDataWrapper = GetPendingConnectionsDataWrapper();
            UserController.Instance.UpdateProfileData(CurrentModel.LoginedUser);

            searchBarView         = new SearchBarView();
            searchBarView.Clear  += OnSearchClear;
            searchBarView.Search += OnSearch;

            _wrapper     = new ConnectListWrapper(CurrentModel);
            UserListView = new ListView
            {
                RefreshCommand         = _wrapper.RefreshCommand,
                HasUnevenRows          = true,
                ItemTemplate           = new DataTemplate(typeof(ConnectionCell)),
                SeparatorVisibility    = SeparatorVisibility.None,
                IsPullToRefreshEnabled = false,
                ItemsSource            = GetItemsSource(),
                //ItemsSource = CurrentModel,
                BindingContext = _wrapper
            };
            UserListView.SetBinding <ConnectListWrapper>(ListView.IsRefreshingProperty, vm => vm.IsBusy, BindingMode.OneWay);

            var buttonLayout = new StackLayout
            {
                Orientation       = StackOrientation.Horizontal,
                Spacing           = 0,
                HorizontalOptions = LayoutOptions.Fill,
                Children          =
                {
                    new ContentView {
                        Content = GetButton(AppResources.ProfileAllContacsBtnHeader, AppResources.MenuColor, OnAllContactsClicked), WidthRequest = AppProvider.Screen.Width / 3
                    },
                    new ContentView {
                        Content = GetButton(AppResources.ProfilePendingContacsBtnHeader, AppResources.AgendaCongressoColor, OnPendingContactsClicked), WidthRequest = AppProvider.Screen.Width / 3
                    },
                    new ContentView {
                        Content = GetButton(AppResources.ProfileRatingBtnHeader, AppResources.AgendaExpoColor, OnRankingClicked), WidthRequest = AppProvider.Screen.Width / 3
                    },
                },
                Padding = new Thickness(0)
            };

            lowerLayout = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
            };
            GetLowerLayoutChidren(selectedContactedList);

            StackLayout layout = new StackLayout
            {
                Orientation = StackOrientation.Vertical,
                Children    =
                {
                    new UserHeaderView(CurrentModel.LoginedUser, false, false, false),
                    buttonLayout,
                    lowerLayout
                }
            };

            BGLayoutView bgLayout = new BGLayoutView(AppResources.DefaultBgImage, layout, true, true);

            // BGLayoutView bgLayout = new BGLayoutView(AppResources.DefaultBgImage, layout, false, true);

            //Content = layout;
            Content = bgLayout;
        }