示例#1
0
        protected override void SetupSubviews()
        {
            base.SetupSubviews();

            ContentView = new UIView {
                BackgroundColor = AppColors.ContentPrimary
            };

            VacationsPager      = new UIView();
            VacationPageControl = new UIPageControl
            {
                Pages = Enum.GetValues(typeof(VacationType)).Length, PageIndicatorTintColor = AppColors.TextBody,
                CurrentPageIndicatorTintColor = AppColors.TextPrimary
            };

            AboveDateSeparator     = new UIView().SetSeparatorStyle();
            DateBeginView          = new LargeDateControl(AppColors.TextPrimary);
            DateEndView            = new LargeDateControl(AppColors.TextSecondary);
            BelowDateSeparator     = new UIView().SetSeparatorStyle();
            StatusSegmentedControl = new UISegmentedControl(Strings.Approved, Strings.Closed)
            {
                TintColor = AppColors.TextSecondary
            };

            StartDatePicker = new UIDatePicker {
                Mode = UIDatePickerMode.Date
            };

            EndDatePicker = new UIDatePicker {
                Mode = UIDatePickerMode.Date
            };

            DatePickerToolbar = new UIToolbar
            {
                BarStyle = UIBarStyle.Default, Translucent = true, TintColor = AppColors.TextPrimary
            };

            var doneButton = new UIBarButtonItem()
            {
                Title = Strings.Done,
                Style = UIBarButtonItemStyle.Plain,
            };

            doneButton.ClickedWeakSubscribe((sender, args) => HideDatePickers());
            var space = new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace);

            DatePickerToolbar.SetItems(new[] { space, doneButton }, false);
            DatePickerToolbar.UserInteractionEnabled = true;

            ActivityIndicator = new ActivityIndicatorView(80, 1);
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var menuButton = new UIBarButtonItem(UIImage.FromBundle("Menu"), UIBarButtonItemStyle.Plain, null);

            menuButton.ClickedWeakSubscribe(OnMenuClick);

            NavigationItem.LeftBarButtonItem = menuButton;

            _navbarAddButton = new UIButton(UIButtonType.Custom)
            {
                ImageEdgeInsets          = new UIEdgeInsets(8, 0, 8, 0),
                BackgroundColor          = UIColor.Clear,
                SemanticContentAttribute = UISemanticContentAttribute.ForceRightToLeft
            }
            .WithImageForAllStates(UIImage.FromBundle("Plus"));

            _navbarAddButton.ImageView.ContentMode = UIViewContentMode.ScaleAspectFit;

            NavigationItem.RightBarButtonItem = new UIBarButtonItem(_navbarAddButton);

            NavigationItem.CreateAndSetScreenTitleLabel(out _navbarTitleLabel);
        }