示例#1
0
        private void Rebind()
        {
            if (!isStarted)
            {
                return;
            }

            rebindCounter++;

            if (currentTimeEntry == null)
            {
                durationButton.SetTitle(DefaultDurationText, UIControlState.Normal);
                actionButton.Apply(Style.NavTimer.StartButton);
            }
            else
            {
                var duration = currentTimeEntry.GetDuration();

                durationButton.SetTitle(duration.ToString(@"hh\:mm\:ss"), UIControlState.Normal);
                actionButton.Apply(Style.NavTimer.StopButton);
                actionButton.Hidden = currentTimeEntry.State != TimeEntryState.Running;

                var counter = rebindCounter;
                DispatchQueue.MainQueue.DispatchAfter(
                    TimeSpan.FromMilliseconds(1000 - duration.Milliseconds),
                    delegate {
                    if (counter == rebindCounter)
                    {
                        Rebind();
                    }
                });
            }
        }
 private void RebindMoodButtons()
 {
     if (userMood == FeedbackMessage.Mood.Positive)
     {
         positiveMoodButton.Apply(Style.Feedback.PositiveMoodButtonSelected);
     }
     else
     {
         positiveMoodButton.Apply(Style.Feedback.PositiveMoodButton);
     }
     if (userMood == FeedbackMessage.Mood.Neutral)
     {
         neutralMoodButton.Apply(Style.Feedback.NeutralMoodButtonSelected);
     }
     else
     {
         neutralMoodButton.Apply(Style.Feedback.NeutralMoodButton);
     }
     if (userMood == FeedbackMessage.Mood.Negative)
     {
         negativeMoodButton.Apply(Style.Feedback.NegativeMoodButtonSelected);
     }
     else
     {
         negativeMoodButton.Apply(Style.Feedback.NegativeMoodButton);
     }
 }
示例#3
0
        private void BindTagsButton(UIButton v)
        {
            var text = String.Join(", ", model.Tags.Select((t) => t.To.Name));

            if (String.IsNullOrEmpty(text))
            {
                v.Apply(Style.EditTimeEntry.NoTags);
                v.SetTitle("EditEntryTagsHint".Tr(), UIControlState.Normal);
            }
            else
            {
                v.Apply(Style.EditTimeEntry.WithTags);
                v.SetTitle(text, UIControlState.Normal);
            }
        }
        private void BindClientButton (UIButton v)
        {
            if (model.Client == null) {
                v.Apply (Style.NewProject.NoClient);
                v.SetTitle ("NewProjectClientHint".Tr (), UIControlState.Normal);
            } else {
                var text = model.Client.Name;
                if (String.IsNullOrEmpty (text)) {
                    text = "NewProjectNoNameClient".Tr ();
                }

                v.Apply (Style.NewProject.WithClient);
                v.SetTitle (text, UIControlState.Normal);
            }
        }
示例#5
0
        private void BindClientButton(UIButton v)
        {
            if (model.Client == null)
            {
                v.Apply(Style.NewProject.NoClient);
                v.SetTitle("NewProjectClientHint".Tr(), UIControlState.Normal);
            }
            else
            {
                var text = model.Client.Name;
                if (String.IsNullOrEmpty(text))
                {
                    text = "NewProjectNoNameClient".Tr();
                }

                v.Apply(Style.NewProject.WithClient);
                v.SetTitle(text, UIControlState.Normal);
            }
        }
示例#6
0
        public async override void ViewDidLoad()
        {
            base.ViewDidLoad();

            ViewModel = await NewProjectViewModel.Init(workspaceId);

            clientBinding = this.SetBinding(() => ViewModel.ClientName).WhenSourceChanges(() => {
                var name = string.IsNullOrEmpty(ViewModel.ClientName) ? "NewProjectClientHint".Tr() : ViewModel.ClientName;
                if (string.IsNullOrEmpty(ViewModel.ClientName))
                {
                    clientButton.Apply(Style.NewProject.ClientButton).Apply(Style.NewProject.NoClient);
                }
                else
                {
                    clientButton.Apply(Style.NewProject.WithClient);
                }
                clientButton.SetTitle(name, UIControlState.Normal);
            });
        }
示例#7
0
        public ReloadTableViewFooter()
        {
            errorLabel = new UILabel ();
            errorLabel.Text = "FooterErrorLoadingLabel".Tr ();
            errorLabel.Apply (Style.Log.ReloadTableViewFooterLabel);

            syncButton = UIButton.FromType (UIButtonType.System);
            syncButton.Apply (Style.Log.ReloadTableViewFooterButton);
            syncButton.SetTitle ("FooterTryAgainLabel".Tr (), UIControlState.Normal);

            syncButton.TouchUpInside += (sender, e) => {
                if (SyncButtonPressedHandler != null) {
                    SyncButtonPressedHandler.Invoke ();
                }
            };

            Add (errorLabel);
            Add (syncButton);
        }
示例#8
0
        public ReloadTableViewFooter()
        {
            errorLabel      = new UILabel();
            errorLabel.Text = "FooterErrorLoadingLabel".Tr();
            errorLabel.Apply(Style.Log.ReloadTableViewFooterLabel);

            syncButton = UIButton.FromType(UIButtonType.System);
            syncButton.Apply(Style.Log.ReloadTableViewFooterButton);
            syncButton.SetTitle("FooterTryAgainLabel".Tr(), UIControlState.Normal);

            syncButton.TouchUpInside += (sender, e) => {
                if (SyncButtonPressedHandler != null)
                {
                    SyncButtonPressedHandler.Invoke();
                }
            };

            Add(errorLabel);
            Add(syncButton);
        }
示例#9
0
 public static void NormalItem (UIButton v)
 {
     v.Apply (MenuItem);
     v.SetTitleColor (Color.Gray, UIControlState.Normal);
     v.SetTitleColor (Color.White, UIControlState.Highlighted);
 }
示例#10
0
 private void Rebind()
 {
     nameTextField.Apply(BindNameField);
     clientButton.Apply(BindClientButton);
 }
示例#11
0
 public static void NormalItem(UIButton v)
 {
     v.Apply(MenuItem);
     v.SetTitleColor(Color.Gray, UIControlState.Normal);
     v.SetTitleColor(Color.White, UIControlState.Highlighted);
 }
 private void BindTagsButton (UIButton v)
 {
     var text = String.Join (", ", model.Tags.Select ((t) => t.To.Name));
     if (String.IsNullOrEmpty (text)) {
         v.Apply (Style.EditTimeEntry.NoTags);
         v.SetTitle ("EditEntryTagsHint".Tr (), UIControlState.Normal);
     } else {
         v.Apply (Style.EditTimeEntry.WithTags);
         v.SetTitle (text, UIControlState.Normal);
     }
 }