Bug 59905 - Frame does not apear
Summary: Frame does not apear
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.4.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-10-02 19:24 UTC by Roman
Modified: 2018-01-13 01:31 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

screenshot (84.90 KB, image/jpeg)
2017-10-02 20:21 UTC, Roman
view application (111.08 KB, image/jpeg)
2017-10-02 20:24 UTC, Roman

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Roman 2017-10-02 19:24:04 UTC
This is my code

public partial class HistoryPeriod : ContentPage
        private Frame _frame;
        private StackLayout _stackDate;
        private RadioButton _radioButtonDay, _radioButtonMonth, _radioButtonPeriod, _radioButtonLastWeek;
        private DatePicker _datePickerFrom, _datePickerTo;
        public HistoryPeriod()

            GroupBox groupBox = new GroupBox();
            _radioButtonDay = new RadioButton();
            _radioButtonDay.Text = Resource.forToday;

            _radioButtonLastWeek = new RadioButton();
            _radioButtonLastWeek.Text = Resource.lastWeek;
            _radioButtonMonth = new RadioButton();
            _radioButtonMonth.Text = Resource.forCurrentMonth;
            _radioButtonPeriod = new RadioButton();
            _radioButtonPeriod.Text = Resource.forSelectedPeriod;
            _radioButtonPeriod.OnChangeChecked += RadioButtonPeriod_OnChangeChecked;


            _frame = new Frame();
            _frame.BackgroundColor = Color.AliceBlue;
            _frame.IsVisible = false;

            _stackDate = new StackLayout();
            _stackDate.HeightRequest = 300;
            Label labelFromDate = new Label();
            labelFromDate.Text = Resource.fromDate;
            _datePickerFrom = new DatePicker();
            _datePickerFrom.Format = "D";
            _datePickerFrom.MinimumDate = new DateTime(2010, 1, 1);
            _datePickerFrom.MaximumDate = new DateTime(2083, 4, 27);
            _datePickerFrom.DateSelected += DatePicker_DateSelected;

            Label labelToDate = new Label();
            labelToDate.Text = Resource.toDate;
            _datePickerTo = new DatePicker();
            _datePickerTo.Format = "D";
            _datePickerTo.MinimumDate = new DateTime(2010, 1, 1);
            _datePickerTo.MaximumDate = new DateTime(2083, 4, 27);
            _datePickerTo.DateSelected += DatePicker_DateSelected;


            _frame.Content = _stackDate;

            Button butShow = new Button();
            butShow.Text = Resource.show;
            butShow.BorderRadius = 20;
            butShow.Clicked += ButShow_Clicked;

        private void DatePicker_DateSelected(object sender, DateChangedEventArgs e)
            if (sender == _datePickerFrom) _datePickerTo.MinimumDate = _datePickerFrom.Date.AddDays(1);
            else _datePickerFrom.MaximumDate = _datePickerTo.Date.AddDays(-1);

        private async void ButShow_Clicked(object sender, EventArgs e)
            Record[] records = null;
            RecordDataStorage storage = new RecordDataStorage();
            if (_radioButtonDay.Checked) records = storage.GetForToday();
            else if (_radioButtonLastWeek.Checked) records = storage.GetForPeriod(DateTime.Now.AddDays(-7), DateTime.Now);
            else if (_radioButtonMonth.Checked) records = storage.GetForCurrentMonth();
            else if (_radioButtonPeriod.Checked) records = storage.GetForPeriod(_datePickerFrom.Date, _datePickerTo.Date);
            if (records.Length == 0)
                await DisplayAlert("", Resource.noData, "Ok");
            else await Navigation.PushAsync(new HistoryList(records), true);

        private void RadioButtonPeriod_OnChangeChecked(RadioButton radioButton, bool isChecked)
            if (isChecked) _frame.IsVisible = true;
            else _frame.IsVisible = false;

In version 2.3 _frame appears after click _radioButtonPeriod. But now after update to 2.4 version it does not appear.
What can I do? Really cannot you fix one bug in order to break working code?
Comment 1 Paul DiPietro [MSFT] 2017-10-02 19:32:33 UTC
Please keep comments civil. We provide prereleases in the hopes that any potential regressions might be caught, and in this case there may be one that slipped through. The code provided is missing code not present. A reproduction project with the minimal amount of code required to reproduce the behavior will help us to investigate this further.
Comment 2 Roman 2017-10-02 19:37:41 UTC
How can I help you?
Comment 3 Roman 2017-10-02 20:21:41 UTC
Created attachment 25058 [details]

this is view application on 2.3.270 version
Comment 4 Roman 2017-10-02 20:24:20 UTC
Created attachment 25059 [details]
view application

this is view of application on 2.3.270 version in case when last radiobutton checked
Comment 5 Paul DiPietro [MSFT] 2017-10-02 20:58:55 UTC
What was meant was that it appears not all of the necessary code was pasted and it refers to other classes (such as Record or RecordDataStorage). Rather than posting screenshots, putting together a reproduction project that we can run with the minimal amount of code possible necessary to reproduce the reported behavior will help us to investigate further.
Comment 6 Roman 2017-10-03 05:48:35 UTC
You don't need ButShow_Clicked(object sender, EventArgs e) method. It is enough class constructor and RadioButtonPeriod_OnChangeChecked(RadioButton radioButton, bool isChecked) from this code to reproduce. I can only give you GroupBox and RadioButton descriptions. Wait 10 hours and I will give you code. Have a nice mood!
Comment 7 Roman 2017-10-03 18:15:21 UTC
using Android.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Xamarin.Forms;

namespace Controls
    public class RadioButton : Grid
        private Image _image;
        private ImageSource _checkedImg, _uncheckedImg;
        private bool _checked;
        private Label _label;
        private object _lockingObject;
        public event Action<RadioButton, bool> OnChangeChecked;

        public RadioButton() : base()
            this.RowDefinitions.Add(new RowDefinition { Height = new GridLength(1, GridUnitType.Star) });
            this.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(1, GridUnitType.Star) });
            this.ColumnDefinitions.Add(new ColumnDefinition { Width = new GridLength(9, GridUnitType.Star) });
            this.Padding = new Thickness(0, 10);
            this.BackgroundColor = Color.Transparent;
            TapGestureRecognizer tapGestureRecognizer = new TapGestureRecognizer();
            tapGestureRecognizer.Tapped += TapGestureRecognizer_Tapped;
            _checkedImg = ImageSource.FromResource("Controls.Images.RadioButton.checked.png");
            _uncheckedImg = ImageSource.FromResource("Controls.Images.RadioButton.unchecked.png");
            _image = new Image();
            _image.Source = _uncheckedImg;
            this.Children.Add(_image, 0, 0);
            this.PropertyChanged += RadioButton_PropertyChanged;

        public bool Checked
            get { return _checked; }
            private set
                _checked = value;
                if (_checked) _image.Source = _checkedImg;
                else _image.Source = _uncheckedImg;
                if (OnChangeChecked != null) OnChangeChecked(this, value);

        public void Check()
            if (Checked != true) Checked = true;

        internal void UnCheck()
            if (Checked != false) Checked = false;

        internal void SetLockingObject(object obj)
            _lockingObject = obj;

        private void RadioButton_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
            if(e.PropertyName == "BackgroundColor")


        private void TapGestureRecognizer_Tapped(object sender, EventArgs e)

        public string Text
                return _label == null ? "" : _label.Text;
                if (_label == null)
                    _label = new Label();
                    _label.VerticalOptions = LayoutOptions.Center;
                    _label.HorizontalOptions = LayoutOptions.Start;
                    this.Children.Add(_label, 1, 0);
                _label.Text = value;
Comment 8 Roman 2017-10-03 18:15:55 UTC
using Android.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Xamarin.Forms;

namespace Controls
    public class GroupBox:StackLayout
        private object _lockingObject;
        public GroupBox(/*StackOrientation orientation*/)
            // Orientation = orientation;
            Orientation = StackOrientation.Vertical;
            _lockingObject = new object();

        protected override void OnChildAdded(Element child)
            if(child is RadioButton)
                RadioButton radioButton = child as RadioButton;
                radioButton.OnChangeChecked += RadioButton_OnChangeChecked;

        private void RadioButton_OnChangeChecked(RadioButton radioButton, bool isChecked)
                foreach(View view in Children)
                    if (view != radioButton && view is RadioButton) (view as RadioButton).UnCheck();
Comment 9 Roman 2017-10-03 18:16:59 UTC
How can I join to Xamarin developing team?
Comment 10 Paul DiPietro [MSFT] 2018-01-03 20:15:35 UTC
As we never received a full reproduction project (not pasted code nor individual files but a complete, zipped solution), this will be closed. Please open a new issue on GitHub at https://github.com/xamarin/Xamarin.Forms/issues if the issue still occurs on the latest 2.5.0 stable release.
Comment 11 Roman 2018-01-13 01:31:34 UTC
I've checked. All right with this issue but it happened new problem