Exemplo n.º 1
0
        /// <summary>
        /// Handles the TextChanged event of the ValueTextBox control.
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        void ValueTextBox_TextChanged(object sender, EventArgs e)
        {
            if (SelectedParameter == null)
            {
                return;
            }
            if (_doNotUpdateParameterValue)
            {
                return;
            }

            var wasValueSet = SelectedParameter.TrySetValue(ValueTextBox.Text, Parser.Current);

            var selStart = ValueTextBox.SelectionStart;
            var selLen   = ValueTextBox.SelectionLength;

            if (!wasValueSet)
            {
                ValueTextBox.BackColor = EditorColors.Error;
            }
            else
            {
                ValueTextBox.BackColor = EditorColors.Normal;
                RefreshSelectedItem();
            }

            // Restore focus to the ValueTextBox
            ValueTextBox.Focus();
            ValueTextBox.SelectionLength = selLen;
            ValueTextBox.SelectionStart  = selStart;
        }
Exemplo n.º 2
0
        public async override System.Threading.Tasks.Task Initialize()
        {
            IsBusy            = true;
            selectedParameter = (SelectedParameter)NavigationParameter;
            // This Value will replace with actual  latitude and longitude  with using Xam.plugin Locator
            var myassistants = await getAssistantsRequest.GetAssistants(19.22, 72.85);

            Myassistants = new ObservableCollection <Myassistant>(myassistants);

            if (selectedParameter != null)
            {
                if (selectedParameter.selectedProfession != null)
                {
                    Myassistants = UtilitiesClass.ToObservableCollection(Myassistants.Where(c => c.profession == selectedParameter.selectedProfession).ToList <Myassistant>());
                }
                if (selectedParameter.selectedRatting != null)
                {
                    Myassistants = UtilitiesClass.ToObservableCollection(Myassistants.Where(c => c.ratting == selectedParameter.selectedRatting).ToList <Myassistant>());
                }
                if (selectedParameter.selectedLocalKnowlage != null)
                {
                    if (selectedParameter.selectedLocalKnowlage == "Yes")
                    {
                        Myassistants = UtilitiesClass.ToObservableCollection(Myassistants.Where(c => c.localplaceknowledge == 1).ToList <Myassistant>());
                    }
                    else
                    {
                        Myassistants = UtilitiesClass.ToObservableCollection(Myassistants.Where(c => c.localplaceknowledge == 0).ToList <Myassistant>());
                    }
                }
            }
            foreach (var item in Myassistants)
            {
                var pin = new Pin()
                {
                    ZIndex   = item.assistantId,
                    Type     = PinType.Place,
                    Label    = item.name,
                    Address  = "Profession : " + item.profession + " Wages($) " + item.wagesPerHour,
                    Position = new Position(item.lat, item.lng),
                };
                pin.Clicked += (sender, e) =>

                {
                    var clickPin = (Pin)sender;
                    Navigation.NavigateToAsync("AssistantView", clickPin.ZIndex);
                };
                Pins.Add(pin);
            }
            IsBusy = false;

            RaisePropertyChanged("Myassistants");
        }