Example #1
0
        public TestTonePage()
        {
            testToneSwitchView = new SwitchSettingView();
            testToneSwitchView.Caption.Text    = "Generate Test Tone";
            testToneSwitchView.Switch.Toggled += Switch_Toggled;

            frequencySliderView = new SliderSettingView();
            frequencySliderView.Caption.Text   = "Frequency";
            frequencySliderView.Value.Text     = "? Hz";
            frequencySliderView.Slider.Minimum = 0;
            frequencySliderView.Slider.Maximum = knobPositions;

            frequencySliderView.Slider.ValueChanged += Slider_ValueChanged;

            var footer = new Label
            {
                Text              = "CocosJuce Forms",
                FontSize          = Font.SystemFontOfSize(24, FontAttributes.Bold).FontSize,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions   = LayoutOptions.EndAndExpand
            };

            // Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

            this.Content = new StackLayout
            {
                Padding  = new Thickness(0, 70, 0, 0),
                Children =
                {
                    testToneSwitchView,
                    frequencySliderView,
                    footer,
                }
            };

            UpdateFrequency(frequency);
        }
Example #2
0
        public TestTonePage()
        {
            testToneSwitchView = new SwitchSettingView();
            testToneSwitchView.Caption.Text = "Generate Test Tone";
            testToneSwitchView.Switch.Toggled += Switch_Toggled;

            frequencySliderView = new SliderSettingView();
            frequencySliderView.Caption.Text = "Frequency";
            frequencySliderView.Value.Text = "? Hz";
            frequencySliderView.Slider.Minimum = 0;
            frequencySliderView.Slider.Maximum = knobPositions;

            frequencySliderView.Slider.ValueChanged += Slider_ValueChanged;

            var footer = new Label
            {
                Text = "CocosJuce Forms",
                FontSize = Font.SystemFontOfSize(24, FontAttributes.Bold).FontSize,
                HorizontalOptions = LayoutOptions.Center,
                VerticalOptions =  LayoutOptions.EndAndExpand
            };

            // Accomodate iPhone status bar.
            this.Padding = new Thickness(10, Device.OnPlatform(20, 0, 0), 10, 5);

            this.Content = new StackLayout
            {

                Padding = new Thickness(0, 70, 0 , 0),
                Children =
                {
                    testToneSwitchView,
                    frequencySliderView,
                    footer,
                }
            };

            UpdateFrequency(frequency);
        }