Пример #1
0
 private void DatePicker_Tapped(object sender, EventArgs e)
 {
     if ((this.BindingContext as OrdonnanceCreateEditViewModel).CanEdit)
     {
         MyDatePicker.Focus();
     }
 }
Пример #2
0
        protected override void OnElementPropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            base.OnElementPropertyChanged(sender, e);
            MyDatePicker Content = sender as MyDatePicker;

            Control.BorderStyle = UITextBorderStyle.None;

            if (e.PropertyName == MyDatePicker.TextColorProperty.PropertyName)
            {
                SetTextColor(Content);
            }
            if (e.PropertyName == MyDatePicker.FontSizeProperty.PropertyName)
            {
                SetFontSize(Content);
            }
            if (e.PropertyName == MyDatePicker.HorizontalTextAlignmentProperty.PropertyName)
            {
                SetXAlign(Content);
            }
            if (e.PropertyName == MyDatePicker.IsFocusedProperty.PropertyName)
            {
                this.Control.Text      = Content.Date.ToString(Content.Format);
                this.Control.TextColor = Content.TextColor.ToUIColor();
            }
        }
Пример #3
0
 private void SetTitle(MyDatePicker Content)
 {
     if (!string.IsNullOrEmpty(Content.Title))
     {
         this.Control.Text      = Content.Title;
         this.Control.TextColor = Content.PlaceholderColor.ToUIColor();
     }
 }
Пример #4
0
        private void SetFontSize(MyDatePicker Content)
        {
            Typeface font  = Typeface.CreateFromAsset(Forms.Context.Assets, "MyriadProRegular.ttf");
            TextView label = (TextView)Control;

            label.Typeface        = font;
            this.Control.TextSize = Content.FontSize;
        }
Пример #5
0
 private void OnMyButtonClicked(object sender, EventArgs e)
 {
     Device.BeginInvokeOnMainThread(() =>
     {
         if (MyDatePicker.IsFocused)
         {
             MyDatePicker.Unfocus();
         }
         MyDatePicker.Focus();
     });
 }
Пример #6
0
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.DatePicker> e)
        {
            base.OnElementChanged(e);
            if (e.NewElement != null)
            {
                MyDatePicker Content = e.NewElement as MyDatePicker;

                SetTextColor(Content);
                SetFontSize(Content);
                SetXAlign(Content);
                SetTitle(Content);
            }
        }
Пример #7
0
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.DatePicker> e)
        {
            base.OnElementChanged(e);
            if (e.NewElement != null)
            {
                MyDatePicker Content = e.NewElement as MyDatePicker;

                SetTextColor(Content);
                SetFontSize(Content);
                SetXAlign(Content);
                SetTitle(Content);

                ShapeDrawable shape = new ShapeDrawable(new RectShape());
                shape.Paint.Color       = Xamarin.Forms.Color.Transparent.ToAndroid();
                shape.Paint.StrokeWidth = 5;
                shape.Paint.SetStyle(Paint.Style.Stroke);
                this.Control.SetBackground(shape);
            }
        }
 public void InitializeComponent()
 {
     if (this._contentLoaded)
     {
         return;
     }
     this._contentLoaded = true;
     Application.LoadComponent(this, new Uri("/VKClient.Common;component/SettingsEditProfilePage.xaml", UriKind.Relative));
     this.ucHeader     = (GenericHeaderUC)base.FindName("ucHeader");
     this.scrollViewer = (ScrollViewer)base.FindName("scrollViewer");
     this.stackPanel   = (StackPanel)base.FindName("stackPanel");
     this.PhotoMenu    = (ContextMenu)base.FindName("PhotoMenu");
     this.datePicker   = (MyDatePicker)base.FindName("datePicker");
     this.textBoxPanel = (TextBoxPanelControl)base.FindName("textBoxPanel");
     //
     this.rectangleGeometry  = (RectangleGeometry)base.FindName("rectangleGeometry");
     this.rectangleGeometry2 = (RectangleGeometry)base.FindName("rectangleGeometry2");
     this.rectangleGeometry3 = (RectangleGeometry)base.FindName("rectangleGeometry3");
 }
Пример #9
0
 private void SetXAlign(MyDatePicker Content)
 {
     this.Control.TextAlignment = IosUtilits.ToUITextAlignment(Content.HorizontalTextAlignment);
 }
Пример #10
0
 private void SetFontSize(MyDatePicker Content)
 {
     Control.Font = UIFont.FromName("Myriad Pro", Content.FontSize);
 }
Пример #11
0
 private void SetTextColor(MyDatePicker Content)
 {
     this.Control.TextColor = Content.TextColor.ToUIColor();
 }
Пример #12
0
 private void SetTextColor(MyDatePicker Content)
 {
     this.Control.SetTextColor(Content.TextColor.ToAndroid());
 }
Пример #13
0
 public void OnTodayClicked(object sender, EventArgs args)
 {
     MyDatePicker.SelectItemForce(DateTime.Now);
 }