/// <summary>
        /// Creates a new popup page to edit track properties
        /// </summary>
        /// <param name="track">track to edit</param>
        public AddTrackPopupPage(Track track)
        {
            this.CloseWhenBackgroundIsClicked = true;

            this.InitializeComponent();

            this.BindingContext = this.viewModel = new AddTrackPopupViewModel(track);
        }
        public void TestDefaultCtor()
        {
            // set up
            var track = UnitTestHelper.GetDefaultTrack();

            track.CalculateStatistics();

            // run
            var viewModel = new AddTrackPopupViewModel(track);

            // check
            Assert.AreEqual(track.Name, viewModel.TrackName, "is not a flight track");
            Assert.AreEqual(track.IsFlightTrack, viewModel.IsFlightTrack, "is not a flight track");
            Assert.IsTrue(viewModel.IsColorPickerVisible, "color picker must be visible");
            Assert.IsTrue(viewModel.SelectedTrackColor.Any(), "selected track color must contain value");

            // modify values
            viewModel.TrackName          = "Track2";
            viewModel.SelectedTrackColor = "0000FF";
            viewModel.IsFlightTrack      = false;
        }