Example #1
0
        public SegmentControlGettingStartedCSharp()
        {
            var mainGrid = new Grid();
            // >> segmentcontrol-gettingstarted-csharp
            RadSegmentedControl segmentControlText = new RadSegmentedControl()
            {
                VerticalOptions = LayoutOptions.Start, HeightRequest = 60,
                ItemsSource     = new List <string>()
                {
                    "Popular", "Library", "Playlists", "Friends"
                },
            };

            // << segmentcontrol-gettingstarted-csharp
            mainGrid.Children.Add(segmentControlText);

            // >> segmentcontrol-gettingstarted-images-csharp
            RadSegmentedControl segmentControlImages = new RadSegmentedControl()
            {
                VerticalOptions = LayoutOptions.Start,
                HeightRequest   = 60,
                ItemsSource     = new List <FileImageSource>()
                {
                    "available.png", "away.png", "busy.png"
                },
            };

            // << segmentcontrol-gettingstarted-images-csharp
            mainGrid.Children.Add(segmentControlImages, 0, 1);

            this.Content = mainGrid;
        }
Example #2
0
        private void SelectSegment()
        {
            if (this.IsSelected)
            {
                return;
            }

            RadSegmentedControl segmentedControl = this.segmentOwner.owner;

            segmentedControl.SelectedItem = segmentedControl.ItemsControl.ItemFromContainer(this.segmentOwner);
            this.RaisePropertyChangedEvent(SelectionItemPatternIdentifiers.IsSelectedProperty, false, true);
            this.RaiseAutomationEvent(AutomationEvents.SelectionItemPatternOnElementSelected);
        }
Example #3
0
        public SegmentControlGettingStartedCSharp()
        {
            // >> segmentcontrol-gettingstarted-csharp
            RadSegmentedControl segmentControl = new RadSegmentedControl()
            {
                VerticalOptions = LayoutOptions.Start, HeightRequest = 60,
                ItemsSource     = new List <string>()
                {
                    "Popular", "Library", "Playlists", "Friends"
                },
            };

            // << segmentcontrol-gettingstarted-csharp

            this.Content = segmentControl;
        }
Example #4
0
 /// <summary>
 ///  Initializes a new instance of the <see cref="RadSegmentedControlAutomationPeer"/> class.
 /// </summary>
 /// <param name="owner">The <see cref="RadSegmentedControl"/> that is associated with this <see cref="RadSegmentedControlAutomationPeer"/>.</param>
 public RadSegmentedControlAutomationPeer(RadSegmentedControl owner)
     : base(owner)
 {
     this.segmentedControlOwner = owner;
 }