コード例 #1
0
        /// <summary>
        /// Gets the date.
        /// </summary>
        /// <returns></returns>
        public virtual DateTime?GetDate()
        {
            if (IsPopup)
            {
                // Return null if no date has been set yet.
                if (String.IsNullOrEmpty(InputElement?.GetValue <string>()))
                {
                    return(null);
                }

                var date = InputElement.GetValue(
                    value => DateTime.ParseExact(
                        value,
                        datePickerComponentOptions.DateFormat,
                        CultureInfo.InvariantCulture));

                return(date);
            }
            else
            {
                var year  = GetYear();
                var month = GetMonth();
                var day   = GetDay();
                day = day == -1 ? 1 : day;

                return(new DateTime(year, month, day));
            }
        }
コード例 #2
0
        private AddressModel GetAddressFromNewAddress(
            InputElement firstNameElement,
            InputElement lastNameElement,
            InputElement emailElement,
            InputElement companyElement,
            SelectElement countryElement,
            SelectElement stateProvinceElement,
            InputElement cityElement,
            InputElement address1Element,
            InputElement address2Element,
            InputElement zipPostalCodeElement,
            InputElement phoneElement,
            InputElement faxNumberElement)
        {
            var model = new AddressModel
            {
                Address1 = firstNameElement.GetValue <string>(),
                Address2 = lastNameElement.GetValue <string>(),
                City     = cityElement.GetValue <string>(),
                Company  = companyElement.GetValue <string>(),

                Country = countryElement
                          .SelectedOption
                          .TextHelper()
                          .InnerText,

                Email       = emailElement.GetValue <string>(),
                FaxNumber   = faxNumberElement.GetValue <string>(),
                FirstName   = firstNameElement.GetValue <string>(),
                LastName    = lastNameElement.GetValue <string>(),
                PhoneNumber = phoneElement.GetValue <string>(),

                StateProvince = stateProvinceElement
                                .SelectedOption
                                .TextHelper()
                                .InnerText,

                ZipPostalCode = zipPostalCodeElement.GetValue <string>()
            };

            return(model);
        }
コード例 #3
0
 /// <summary>
 /// Gets the <see cref="TabOnceActiveElementProperty"/> for a container.
 /// </summary>
 /// <param name="element">The container.</param>
 /// <returns>The active element for the container.</returns>
 public static IInputElement?GetTabOnceActiveElement(InputElement element)
 {
     return(element.GetValue(TabOnceActiveElementProperty));
 }
コード例 #4
0
 /// <summary>
 /// Gets the <see cref="TabNavigationProperty"/> for a container.
 /// </summary>
 /// <param name="element">The container.</param>
 /// <returns>The <see cref="KeyboardNavigationMode"/> for the container.</returns>
 public static KeyboardNavigationMode GetTabNavigation(InputElement element)
 {
     return(element.GetValue(TabNavigationProperty));
 }
コード例 #5
0
 /// <summary>
 /// Gets the <see cref="IsTabStopProperty"/> for an element.
 /// </summary>
 /// <param name="element">The container.</param>
 /// <returns>Whether the container is a tab stop.</returns>
 public static bool GetIsTabStop(InputElement element)
 {
     return(element.GetValue(IsTabStopProperty));
 }
コード例 #6
0
ファイル: KeyboardNavigation.cs プロジェクト: KvanTTT/Perspex
 /// <summary>
 /// Gets the <see cref="TabOnceActiveElementProperty"/> for a container.
 /// </summary>
 /// <param name="element">The container.</param>
 /// <returns>The active element for the container.</returns>
 public static IInputElement GetTabOnceActiveElement(InputElement element)
 {
     return element.GetValue(TabOnceActiveElementProperty);
 }
コード例 #7
0
ファイル: KeyboardNavigation.cs プロジェクト: KvanTTT/Perspex
 /// <summary>
 /// Gets the <see cref="TabNavigationProperty"/> for a container.
 /// </summary>
 /// <param name="element">The container.</param>
 /// <returns>The <see cref="KeyboardNavigationMode"/> for the container.</returns>
 public static KeyboardNavigationMode GetTabNavigation(InputElement element)
 {
     return element.GetValue(TabNavigationProperty);
 }
コード例 #8
0
ファイル: InputMethod.cs プロジェクト: soosr/Avalonia
 /// <summary>
 /// Getter for IsInputMethodEnabled AvaloniaProperty
 /// </summary>
 public static bool GetIsInputMethodEnabled(InputElement target)
 {
     return(target.GetValue <bool>(IsInputMethodEnabledProperty));
 }