ListPageViewModel.cs 7.54 KB
Newer Older
Mattia's avatar
Mattia committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
using System;
using System.Collections.ObjectModel;
using Xamarin.Forms;

namespace SampleApp.ViewModels
{
    public class ListPageViewModel
    {
        public ObservableCollection<GroupedAPIFunctionality> APIList { get; set; }
        public ListPageViewModel()
        {
            var listView = new ListView();
            APIList = new ObservableCollection<GroupedAPIFunctionality>();

            var accessibilityFocus = new GroupedAPIFunctionality() { LongName = "Accessibility Focus", ShortName = "AF" };
            var TextToAnnounce = new GroupedAPIFunctionality() { LongName = "Text To Announce", ShortName = "TTA" };
            var explicitTTS = new GroupedAPIFunctionality() { LongName = "Explicit TTS", ShortName = "TTS" };
            var accessibilityTree = new GroupedAPIFunctionality() { LongName = "Accessibility Tree", ShortName = "AT" };
            var miscellanous = new GroupedAPIFunctionality() { LongName = "Miscellanous", ShortName = "M" };

            accessibilityFocus.Add(new APIFunctionality
            {
                Name = "1",
                Description = "Specify which views should receive the accessibility focus"
            });
            accessibilityFocus.Add(new APIFunctionality
            {
                Name = "2",
                Description = "Specify the accessibility focus order",
            });
            accessibilityFocus.Add(new APIFunctionality
            {
                Name = "3",
                Description = "Assign the accessibility focus to a view",
                Availability = "Indirect implementation",
            });
            accessibilityFocus.Add(new APIFunctionality
            {
                Name = "4",
                Description = "Specify actions associated to accessibility focus-related events (e.g., a view acquires or loses the focus)",
                Availability = "Indirect implementation",
            });
            accessibilityFocus.Add(new APIFunctionality
            {
                Name = "5",
                Description = "Determine whether a view has the accessibility focus or which view has the accessibility focus",
                Availability = "Indirect implementation",
            });
            TextToAnnounce.Add(new APIFunctionality
            {
                Name = "6",
                Description = "Specify attributes that contribute to form the text-to-announce",
            });
            TextToAnnounce.Add(new APIFunctionality
            {
                Name = "7",
                Description = "Programmatically define the text-to-announce",
                Availability = "Not available on XAMARIN",
            });
            TextToAnnounce.Add(new APIFunctionality
            {
                Name = "8",
                Description = "Use one view to describe another one",
                Availability = "Semi-direct implementation on iOS",
            });
            TextToAnnounce.Add(new APIFunctionality
            {
                Name = "9",
                Description = "Specify that a view should be announced when changed, even without user interaction",
                Availability = "Not available on XAMARIN",
            });
            TextToAnnounce.Add(new APIFunctionality
            {
                Name = "10",
                Description = "Specify in which language the text-to-announce should be read",
                Availability = "Not available on XAMARIN",
            });
            explicitTTS.Add(new APIFunctionality
            {
                Name = "11",
                Description = "Read a text with the screen-reader TTS",
                Availability = "Indirect Implementation",
            });
            explicitTTS.Add(new APIFunctionality
            {
                Name = "12",
                Description = "Be informed when the screen-reader finishes reading an explicitly provided text",
                Availability = "Not available on XAMARIN",
            });
            explicitTTS.Add(new APIFunctionality
            {
                Name = "13",
                Description = "Customize screen-reader TTS speech features, like pitch, speed, etc...",
                Availability = "Not available on XAMARIN",
            });
            explicitTTS.Add(new APIFunctionality
            {
                Name = "14",
                Description = "Read a text with non-screen-reader TTS (also works when screen-reader is not active)",
            });
            explicitTTS.Add(new APIFunctionality
            {
                Name = "15",
                Description = "Detect whether the non-screen-reader TTS is reading",
                Availability = "Not available on XAMARIN",
            });
            explicitTTS.Add(new APIFunctionality
            {
                Name = "16",
                Description = "Pause the non-screen-reader TTS",
                Availability = "Not available on XAMARIN",
            });
            explicitTTS.Add(new APIFunctionality
            {
                Name = "17",
                Description = "Customize non-screen-reader TTS speech features, like pitch, speed, etc...",
            });
            accessibilityTree.Add(new APIFunctionality
            {
                Name = "18",
                Description = "Aggregate multiple views into a single accessible element",
                Availability = "Semi-direct implementation on iOS",
            });
            accessibilityTree.Add(new APIFunctionality
            {
                Name = "19",
                Description = "Decompose a view into multiple accessibility elements",
                Availability = "Not available on XAMARIN",
            });
            accessibilityTree.Add(new APIFunctionality
            {
                Name = "20",
                Description = "Get the parent accessible element",
                Availability = "Not available on XAMARIN",
            });
            miscellanous.Add(new APIFunctionality
            {
                Name = "21",
                Description = "Detect whether screen-reader is active",
                Availability = "Indirect implementation",
            });
            miscellanous.Add(new APIFunctionality
            {
                Name = "22",
                Description = "Support navigation by specifying which views are headers or panes",
                Availability = "Not available on iOS",

            });
            miscellanous.Add(new APIFunctionality
            {
                Name = "23",
                Description = "Define how to respond to user actions that are only available when the screen reader is active",
                Availability = "Not available on Android",

            });
            miscellanous.Add(new APIFunctionality
            {
                Name = "24",
                Description = "Perform actions on user behalf",
                Availability = "Not available on XAMARIN",
            });
            miscellanous.Add(new APIFunctionality
            {
                Name = "25",
                Description = "Associate arbitrary accessibility-related information to a view",
                Availability = "Not available on XAMARIN",
            });

            APIList.Add(accessibilityFocus);
            APIList.Add(TextToAnnounce);
            APIList.Add(explicitTTS);
            APIList.Add(accessibilityTree);
            APIList.Add(miscellanous);

            listView.ItemsSource = APIList;
            listView.IsGroupingEnabled = true;
            listView.GroupDisplayBinding = new Binding("LongName");
            listView.GroupShortNameBinding = new Binding("ShortName");
        }
    }



}