コード例 #1
0
        private void OnLoaded(object sender, object e)
        {
            PropertyInfo[] props = typeof(Brushes).GetProperties();

            List <object> data = new List <object>(17);

            data.Add(new UI());

            SampleImageHelper.GetPicturePaths().Take(8).ForEach(path => data.Add(new Picture(path)));

            for (int i = 0; i < Math.Min(props.Length, 8); i++)
            {
                if (props[i].Name != "Transparent")
                {
                    data.Add(new Swatch(props[i].Name));
                }
            }

            this.DataContext = _data.ItemsSource = data;

            // Setup 2 way transitions
            Transition[] transitions = (Transition[])FindResource("ForwardBackTransitions");

            for (int i = 0; i < transitions.Length; i += 2)
            {
                ListTransitionSelector selector = new ListTransitionSelector(transitions[i], transitions[i + 1], data);
                TextSearch.SetText(selector, TextSearch.GetText(transitions[i]));
                _selectors.Items.Add(selector);
            }
        }
コード例 #2
0
        private void OnLoaded(object sender, object e)
        {
            PropertyInfo[] props = typeof(Brushes).GetProperties();

            List<object> data = new List<object>(17);

            data.Add(new UI());

            SampleImageHelper.GetPicturePaths().Take(8).ForEach(path => data.Add(new Picture(path)));

            for (int i = 0; i < Math.Min(props.Length, 8); i++)
            {
                if (props[i].Name != "Transparent")
                {
                    data.Add(new Swatch(props[i].Name));
                }
            }

            this.DataContext = _data.ItemsSource = data;

            // Setup 2 way transitions
            Transition[] transitions = (Transition[])FindResource("ForwardBackTransitions");

            for (int i = 0; i < transitions.Length; i += 2)
            {
                ListTransitionSelector selector = new ListTransitionSelector(transitions[i], transitions[i + 1], data);
                TextSearch.SetText(selector, TextSearch.GetText(transitions[i]));
                _selectors.Items.Add(selector);
            }
        }