示例#1
0
        public ProfileContentView(Parameters parameters)
        {
            Model = parameters.UserModel;
            var layout = new StackLayout {
                VerticalOptions = LayoutOptions.FillAndExpand
            };
            var userHeaderView = new UserHeaderView(Model, false);

            if (parameters.OnSaveChanges != null)
            {
                userHeaderView.EditUserProfile += parameters.OnSaveChanges;
            }

            layout.Children.Add(userHeaderView);

            var badgeView = new BadgeGridView(Model);

            layout.Children.Add(badgeView);

            /*
             *          if (parameters.IsBtnEnabled)
             *          {
             *                  var historyView = new ProfileHistoryView (AppModel.Instance.CurrentContactListWrapper);
             *                  layout.Children.Add (historyView);
             *          }
             */

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

            // Content = new ScrollView { Content = layout, BackgroundColor = AppResources.UserBackgroundColor };
            //Content = new ScrollView { Content = bgLayout };
            Content = new ContentView {
                Content = bgLayout
            };
        }
示例#2
0
        public ProfileHistoryPage(UserModel userModel) : base()
        {
            Model = userModel;
            Title = AppResources.Profile;

            var userHeaderView = new UserHeaderView(Model, false);

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

            _historyGridView = new GridView {
                RowSpacing           = 5,
                ColumnSpacing        = 5,
                ContentPaddingBottom = 0,
                ContentPaddingTop    = 0,
                ContentPaddingLeft   = 0,
                ContentPaddingRight  = 0,
                ItemWidth            = width,
                ItemHeight           = 60,
                ItemsSource          = AppModel.Instance.CurrentContactListWrapper,
                ItemTemplate         = new DataTemplate(typeof(ProfileHistoryFastItemCell))
            };

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

            var historylabel = new Label {
                FontSize       = 22,
                Text           = AppResources.ProfileHistoryHeader,
                TextColor      = AppResources.AgendaCongressoColor,
                XAlign         = TextAlignment.Center,
                FontAttributes = FontAttributes.Bold,
                YAlign         = TextAlignment.Center,
                HeightRequest  = 40
            };

            Content = new StackLayout {
                BackgroundColor = Color.White,
                Children        =
                {
                    userHeaderView,
                    historylabel,
                    container
                }
            };

            UserController.Instance.UpdateProfileData(Model);
        }
示例#3
0
        public ProfileGridPage(UserModel userModel) : base()
        {
            Model = userModel;
            Title = AppResources.Profile;

            var userHeaderView = new UserHeaderView(Model, true);

            userHeaderView.EditUserProfile += OnEditUserProfile;

            var btnLayout = new StackLayout {
                Padding     = new Thickness(0),
                Orientation = StackOrientation.Horizontal,
                Children    =
                {
                    GetButton(AppResources.ProfileRatingBtnColor,            AppResources.ProfileRatingBtnHeader,
                              OnRatingClicked,                               new Thickness(20,                         0, 10, 0)),
                    GetButton(AppResources.ProfileContactListBtnColor,       AppResources.ProfileContactListBtnHeader,
                              OnContactListClicked,                          new Thickness(10,                         0, 20, 0))
                }
            };


            var historyButton = new Button {
                FontSize        = 20,
                BackgroundColor = AppResources.ProfileHistoryItemLightColor,
                TextColor       = AppResources.AgendaCongressoColor,
                FontAttributes  = FontAttributes.Bold,
                HeightRequest   = 60,
                Text            = AppResources.ProfileHistoryClickHeader,
                WidthRequest    = AppProvider.Screen.ConvertPixelsToDp(AppProvider.Screen.Width)
            };

            historyButton.Clicked += OnHistoryClicked;

            Content = new ScrollView {
                BackgroundColor = AppResources.UserBackgroundColor,
                Content         = new StackLayout {
                    Orientation     = StackOrientation.Vertical,
                    VerticalOptions = LayoutOptions.StartAndExpand,
                    Children        =
                    {
                        userHeaderView,
                        btnLayout,
                        new BadgeGridView(Model),
                        historyButton
                    }
                }
            };

            UserController.Instance.UpdateProfileData(Model);
        }