コード例 #1
0
ファイル: CheckBoxList.xaml.cs プロジェクト: agamat/Ribbon-1
        private void ListBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (ItemsSource == null)
            {
                return;
            }

            var boolArray = ItemsSource.As <IEnumerable>().OfType <Common.ISelectable>()
                            .Select(o => (o.IsSelected == true)).ToArray();

            var newValue = boolArray.ToInteger();

            if (newValue == ArrayInt)
            {
                return;
            }

            ArrayInt = newValue;
        }
コード例 #2
0
ファイル: VerticalIndicator.cs プロジェクト: agamat/Ribbon-1
        internal void Update()
        {
            if (ItemsSource == null)
            {
                if (_lines != null)
                {
                    _lines.Clear();
                }
                _lines = null;

                return;
            }


            var category = FilterParams == null ? 0 : System.Convert.ToInt32(FilterParams);

            _lines = ItemsSource.SaftyGetProperty <IList <IVisibleLinerData>, IEnumerable>(l => l.OfType <IVisibleLinerData>().Where(o => Equals(o.Category, category)).ToList()
                                                                                           , () => new List <IVisibleLinerData> {
                ItemsSource.As <IVisibleLinerData>()
            });

            _max = _lines.Max(l => l.MaxValue);
        }