public AddRoutineCell(RoutineCellObject rcObject, HairAppBl.Interfaces.IHairBl hairbl) { cellObject = rcObject; mCheckBox = new XLabs.Forms.Controls.CheckBox(); mCheckBox.CheckedChanged += MCheckBox_CheckedChanged; var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, e) => { mCheckBox.Checked = !mCheckBox.Checked; }; var label1 = new Label { Text = rcObject.Name, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)), FontAttributes = FontAttributes.Bold }; var frame = new Frame { Style = (Style)hairbl.Resources["RoutineFrameSelect"], Content = new StackLayout { Style = (Style)hairbl.Resources["RoutineContent"], Orientation = StackOrientation.Horizontal, Children = { mCheckBox, label1 } } }; frame.GestureRecognizers.Add(tapGestureRecognizer); View = frame; }
/// <summary> /// Used for registration with dependency service to ensure it isn't linked out /// </summary> public static void Init() { XLabs.Forms.Controls.CheckBox dds = new XLabs.Forms.Controls.CheckBox(); // intentionally empty }
public RoutineInstanceCell(RoutineInstance instance, HairAppBl.Interfaces.IHairBl hairbl) { mRoutine = instance; mHairBl = hairbl; mCheckBox = new XLabs.Forms.Controls.CheckBox(); mCheckBox.CheckedChanged += MCheckBox_CheckedChanged; mCheckBox.Checked = instance.Checked; var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, e) => { ShowMore(); }; var commentButton = Common.GetButton("comment.png", hairbl); commentButton.Clicked += (sender, e) => { mDetailsFrame.IsVisible = !mDetailsFrame.IsVisible; }; var nameLabel = new Label { Text = instance.Name, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)), FontAttributes = FontAttributes.Bold }; var descriptionLabel = new Label { Text = instance.Description, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)), FontAttributes = FontAttributes.Bold, IsVisible = !String.IsNullOrWhiteSpace(instance.Description) }; mComment = new Editor { HeightRequest = 120, Placeholder = AppResources.AddComment, Text = mRoutine.Comment }; mComment.TextChanged += MComment_TextChanged; mDetailsFrame = new StackLayout { Orientation = StackOrientation.Vertical, Style = (Style)hairbl.Resources["DetailsFrame"], IsVisible = false, Children = { descriptionLabel, mComment } }; var frame = new Frame { Style = (Style)hairbl.Resources["RoutineFrame"], Content = new StackLayout { Orientation = StackOrientation.Vertical, Children = { new StackLayout { Style = (Style)hairbl.Resources["RoutineContent"], Orientation = StackOrientation.Horizontal, Children ={ mCheckBox, nameLabel, commentButton } }, mDetailsFrame } } }; frame.GestureRecognizers.Add(tapGestureRecognizer); View = frame; }
public WashingDayInstanceCalendarCell(WashingDayInstance instance, WashingDayDefinition def, HairAppBl.Interfaces.IHairBl hairbl) : base(hairbl) { this.Instance = instance; this.Definition = def; this.HeaderName = Definition.Name; Color = Definition.ItemColor; var commentLabel = Common.GetCalendarDetailsRow("comment.png", new Label { Text = instance.Comment, FontSize = Device.GetNamedSize(NamedSize.Small, typeof(Label)), }, hairbl); commentLabel.IsVisible = !String.IsNullOrWhiteSpace(instance.Comment); var picContainer = new ScrollView { Orientation = ScrollOrientation.Horizontal }; var picListView = new StackLayout { Orientation = StackOrientation.Horizontal }; picContainer.Content = picListView; foreach (var pic in instance.Pictures) { var img = new ImageButton { HeightRequest = 60, Source = ImageSource.FromFile(pic.Path), BackgroundColor = Color.Transparent }; img.Clicked += Img_Clicked; picListView.Children.Add(img); } var pictureList = Common.GetCalendarDetailsRow("camera.png", picContainer, hairbl); pictureList.IsVisible = instance.Pictures.Count > 0; var showMore = new Button { Text = Resources.AppResources.ShowMore, BackgroundColor = Color.Transparent, TextColor = Color.Blue }; showMore.Clicked += ShowMoreButton_Clicked; var routineList = new StackLayout { Orientation = StackOrientation.Vertical, }; foreach (var r in instance.Routines) { var check = new XLabs.Forms.Controls.CheckBox(); check.Checked = r.Checked; check.IsEnabled = false; var row = new StackLayout { Orientation = StackOrientation.Horizontal }; row.Children.Add(check); row.Children.Add(new Label { Text = r.Name }); routineList.Children.Add(row); } var routineFrame = Common.GetCalendarDetailsRow("list.png", routineList, hairbl); var neededTime = Common.GetCalendarDetailsRow("time.png", new Label { Text = $"{instance.NeededTime.TotalMinutes} {HairApp.Resources.AppResources.Minutes}" }, hairbl); DetailsContent.Add(commentLabel); DetailsContent.Add(routineFrame); DetailsContent.Add(neededTime); DetailsContent.Add(pictureList); DetailsContent.Add(showMore); }