示例#1
0
        public static NSSegmentedControl FromImages(NSImage[] images, NSSegmentSwitchTracking trackingMode, Action action)
        {
            var dispatcher = new NSActionDispatcher(action);
            var control    = _FromImages(images, trackingMode, dispatcher, NSActionDispatcher.Selector);

            control.dispatcher = dispatcher;
            return(control);
        }
示例#2
0
        public static NSSegmentedControl FromLabels(string[] labels, NSSegmentSwitchTracking trackingMode, Action action)
        {
            var dispatcher = new NSActionDispatcher(action);
            var control    = _FromLabels(labels, trackingMode, dispatcher, NSActionDispatcher.Selector);

            control.dispatcher = dispatcher;
            return(control);
        }
示例#3
0
        public void UnselectAllSegments()
        {
            NSSegmentSwitchTracking current = this.Cell.TrackingMode;

            this.Cell.TrackingMode = NSSegmentSwitchTracking.Momentary;

            for (nint i = 0; i < this.SegmentCount; i++)
            {
                SetSelected(false, i);
            }

            this.Cell.TrackingMode = current;
        }