예제 #1
0
        private void SetBindings()
        {
            this.SetBinding(TitleProperty, "Party.Name");
            //Buttons
            _acceptButton.SetBinding(CustomButton.IsEnabledProperty, nameof(MyPartyDetailViewModel.AcceptButtonEnabled));
            _acceptButton.SetBinding(CustomButton.CommandProperty, nameof(MyPartyDetailViewModel.UpdatePartyCommand));
            _cancelButton.SetBinding(CustomButton.CommandProperty, nameof(MyPartyDetailViewModel.ClearFormCommand));
            // set name
            _nameEntry.Input.SetBinding(Entry.TextProperty, nameof(MyPartyDetailViewModel.Name));
            _nameEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, nameof(MyPartyDetailViewModel.ValidName));
            // set description
            _descriptionEntry.Input.SetBinding(Editor.TextProperty, nameof(MyPartyDetailViewModel.Description));
            _descriptionEntry.SetBinding(InputContainer <Editor> .InputValidateProperty,
                                         nameof(MyPartyDetailViewModel.ValidDescription));
            // music genre
            _musicGenrePicker.Input.SetBinding(EnumBindablePicker <MusicGenre> .SelectedItemProperty,
                                               nameof(MyPartyDetailViewModel.MusicGenre));
            // party type
            _partyTypePicker.Input.SetBinding(EnumBindablePicker <PartyType> .SelectedItemProperty, nameof(MyPartyDetailViewModel.PartyType));
            // date and time
            _datePicker.Input.SetBinding(DatePicker.DateProperty, nameof(MyPartyDetailViewModel.Date));
            // set start time
            _startTimePicker.Input.SetBinding(TimePicker.TimeProperty, nameof(MyPartyDetailViewModel.Time));
            // address
            _streetEntry.Input.SetBinding(Entry.TextProperty, nameof(MyPartyDetailViewModel.StreetName));
            _streetEntry.SetBinding(InputContainer <Entry> .InputValidateProperty,
                                    nameof(MyPartyDetailViewModel.ValidStreetname));
            // set city name
            _cityNameEntry.Input.SetBinding(Entry.TextProperty, nameof(MyPartyDetailViewModel.CityName));
            _cityNameEntry.SetBinding(InputContainer <Entry> .InputValidateProperty,
                                      nameof(MyPartyDetailViewModel.ValidCityname));
            // set house number
            _houseNumberEntry.Input.SetBinding(Entry.TextProperty, nameof(MyPartyDetailViewModel.HouseNumber));
            _houseNumberEntry.SetBinding(InputContainer <Entry> .InputValidateProperty,
                                         nameof(MyPartyDetailViewModel.ValidHousenumber));
            // set location
            _priceEntry.Input.SetBinding(Entry.TextProperty, nameof(MyPartyDetailViewModel.Price));
            _priceEntry.SetBinding(InputContainer <Entry> .InputValidateProperty,
                                   nameof(MyPartyDetailViewModel.ValidPrice));
            // set zipcode
            _zipCodetEntry.Input.SetBinding(Entry.TextProperty, nameof(MyPartyDetailViewModel.Zipcode));
            _zipCodetEntry.SetBinding(InputContainer <Entry> .InputValidateProperty,
                                      nameof(MyPartyDetailViewModel.ValidZipcode));
            // set MapPins
            this.SetBinding(MyPartyDetailPage.MapPinsProperty, nameof(MyPartyDetailViewModel.MapPins));
            _deleteParty.SetBinding(MenuItem.CommandProperty, nameof(MyPartyDetailViewModel.DeletePartyCommand));

            //Participants
            _gallerieView.SetBinding(GallerieView.ItemSourceProperty, "Party.Participants");
            _gallerieView.SetBinding(GallerieView.IsVisibleProperty, "ParticipantsVisible");

            _ratingView.SetBinding(PartyRatingView.PartyProperty, "Party");
        }
예제 #2
0
 private void SetBindings()
 {
     // configure GPS range
     _gpsRangeSlider.SetBinding(Slider.ValueProperty, nameof(SettingViewModel.SelectedRange));
     _gpsEnabledSwitch.SetBinding(Switch.IsToggledProperty, nameof(SettingViewModel.GpsEnabled));
     // bind entries to validate input
     _zipCodetEntry.SetBinding(Entry.TextProperty, nameof(SettingViewModel.Zipcode));
     _cityNameEntry.SetBinding(Entry.TextProperty, nameof(SettingViewModel.CityName));
     _numberEntry.SetBinding(Entry.TextProperty, nameof(SettingViewModel.HouseNumber));
     _streetEntry.SetBinding(Entry.TextProperty, nameof(SettingViewModel.StreetName));
     // checks if current input is position on map and change symbol
     _zipCodetEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, nameof(SettingViewModel.ValidZipcode));
     _cityNameEntry.SetBinding(InputContainer <Entry> .InputValidateProperty,
                               nameof(SettingViewModel.ValidCityname));
     _numberEntry.SetBinding(InputContainer <Entry> .InputValidateProperty,
                             nameof(SettingViewModel.ValidHousenumber));
     _streetEntry.SetBinding(InputContainer <Entry> .InputValidateProperty,
                             nameof(SettingViewModel.ValidHousenumber));
     // checks if user want to delete cache
     _clearCacheButton.SetBinding(Button.CommandProperty, nameof(SettingViewModel.ValidateClearCacheCommand));
     _readAgButton.SetBinding(CustomButton.CommandProperty, nameof(SettingViewModel.MoveToReadAgbCommand));
 }
        private void SetBindings()
        {
            // set command
            _cancelBtn.SetBinding(CustomButton.CommandProperty, "MoveToCancelCommand");
            _okBtn.SetBinding(CustomButton.CommandProperty, "MoveTOkCommand");

            // Set binding to text property
            _nameEntry.Input.SetBinding(Entry.TextProperty, "Name");
            _emailEntry.Input.SetBinding(Entry.TextProperty, "Email");

            // Set Bindings to InputValidateProperty
            _nameEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidName");
            _emailEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidEmail");
        }
예제 #4
0
        private void SetBindings()
        {
            //Buttons
            _acceptButton.SetBinding(CustomButton.IsEnabledProperty, nameof(CreatePartyViewModel.AcceptButtonEnabled));
            _clearButton.SetBinding(CustomButton.IsEnabledProperty, nameof(CreatePartyViewModel.ClearButtonEnabled));

            _acceptButton.SetBinding(CustomButton.CommandProperty, "CreatePartyCommand");
            _clearButton.SetBinding(CustomButton.CommandProperty, nameof(CreatePartyViewModel.ClearFormCommand));

            _tapGesture.SetBinding(TapGestureRecognizer.CommandProperty, "LoadImageCommand");
            _image.SetBinding(Image.SourceProperty, "Image");
            _image.GestureRecognizers.Add(_tapGesture);

            _priceContainer.Input.SetBinding(Entry.TextProperty, "Price");

            _nameEntry.Input.SetBinding(Entry.TextProperty, "Name");

            _nameEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidName");

            _descriptionEntry.Input.SetBinding(Editor.TextProperty, "Description");

            _descriptionEntry.SetBinding(InputContainer <Editor> .InputValidateProperty, "ValidDescription");

            _musicGenreSwitch.Input.SetBinding(EnumBindablePicker <MusicGenre> .SelectedItemProperty, "MusicGenre");
            // date and time
            _datePicker.Input.SetBinding(DatePicker.DateProperty, "Date");

            _timePicker.Input.SetBinding(TimePicker.TimeProperty, "Time");
            // address
            _streetEntry.Input.SetBinding(Entry.TextProperty, "StreetName");

            _streetEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidStreetname");

            _cityNameEntry.Input.SetBinding(Entry.TextProperty, "CityName");
            _cityNameEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidCityname");

            _numberEntry.Input.SetBinding(Entry.TextProperty, "HouseNumber");
            _numberEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidHousenumber");

            _priceEntry.Input.SetBinding(Entry.TextProperty, "Price");

            _zipCodetEntry.Input.SetBinding(Entry.TextProperty, "Zipcode");
            _zipCodetEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidZipcode");
        }
예제 #5
0
        public LoginPage()
        {
            BackgroundColor = Color.Red;
            OfflineMessage  = AppResources.OfflineContent;

            //Make sure that the page does not merge in to the status bar on iOS.
            if (Device.OS == TargetPlatform.iOS)
            {
                Padding = new Thickness(0, 20, 0, 0);
            }

            BackgroundColor = Color.White;
            //Bindings

            //Buttons
            _submitButton.SetBinding(Button.CommandProperty, "StartLoginCommand");
            _submitButton.SetBinding(Button.IsEnabledProperty, "CanSubmitForm");

            _useAnonymousButton.SetBinding(Button.CommandProperty, "ContinueAnonymCommand");

            //Entrys
            _usernameEntry.Input.SetBinding(Entry.TextProperty, "Username");
            _usernameEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidUsername");

            _passwordEntry.Input.SetBinding(Entry.TextProperty, "Password");
            _passwordEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidPassword");

            _emailEntry.Input.SetBinding(Entry.TextProperty, "Email");
            _emailEntry.SetBinding(InputContainer <Entry> .InputValidateProperty, "ValidEmail");

            //Switch
            _acceptAgbSwitch.SetBinding(Switch.IsToggledProperty, "AgbAccepted");
            _signUpSwitch.SetBinding(Switch.IsToggledProperty, "SignUp");


            //Events
            _signUpSwitch.Toggled          += SignUpSwitchToggled;
            _usernameEntry.Input.Completed += UsernameCompleted;
            _passwordEntry.Input.Completed += PasswordCompleted;

            _layoutGrid = new Grid
            {
                RowSpacing     = 6,
                ColumnSpacing  = 3,
                Padding        = new Thickness(20, 0),
                RowDefinitions = new RowDefinitionCollection()
                {
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Absolute)
                    },

                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Absolute)
                    },                                                                     //IconCode

                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Star)
                    },

                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },                                                                 //Username
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },                                                                 //Password
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },                                                                 //E-Mail
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },                                                                 //Accept AGB
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },                                                                 //Enable SignUp
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },                                                                 //Submit Button
                    new RowDefinition {
                        Height = new GridLength(1, GridUnitType.Auto)
                    },                                                                 //Anonymous Button

                    new RowDefinition {
                        Height = new GridLength(2, GridUnitType.Star)
                    }
                },
                ColumnDefinitions = new ColumnDefinitionCollection
                {
                    new ColumnDefinition {
                        Width = new GridLength(0, GridUnitType.Absolute)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Star)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(1, GridUnitType.Auto)
                    },
                    new ColumnDefinition {
                        Width = new GridLength(0, GridUnitType.Absolute)
                    }
                },
                Children =
                {
                    { _image,              1, 1 },
                    { _usernameEntry,      1, 3 },
                    { _passwordEntry,      1, 4 },
                    { _emailEntry,         1, 5 },
                    { _agbText,            1, 6 },
                    { _acceptAgbSwitch,    2, 6 },
                    { _registerLabel,      1, 7 },
                    { _signUpSwitch,       2, 7 },
                    { _submitButton,       1, 8 },
                    { _useAnonymousButton, 1, 9 }
                }
            };

            Grid.SetColumnSpan(_image, 2);
            Grid.SetColumnSpan(_usernameEntry, 2);
            Grid.SetColumnSpan(_passwordEntry, 2);
            Grid.SetColumnSpan(_emailEntry, 2);
            Grid.SetColumnSpan(_submitButton, 2);
            Grid.SetColumnSpan(_useAnonymousButton, 2);

            Content = _layoutGrid;
        }