public DataGrid(ListViewCachingStrategy cachingStrategy)
        {
            InitializeComponent();

            _sortingOrders = new Dictionary <int, SortingOrder>();

            _listView = new ListView(cachingStrategy)
            {
                BackgroundColor     = Color.Transparent,
                ItemTemplate        = new DataGridRowTemplateSelector(),
                SeparatorVisibility = SeparatorVisibility.None,
            };

            _listView.ItemSelected += (s, e) => {
                if (SelectionEnabled)
                {
                    SelectedItem = _listView.SelectedItem;
                }
                else
                {
                    _listView.SelectedItem = null;
                }

                ItemSelected?.Invoke(this, e);
            };

            _listView.Refreshing += (s, e) => {
                Refreshing?.Invoke(this, e);
            };

            _listView.SetBinding(ListView.RowHeightProperty, new Binding("RowHeight", source: this));
            Grid.SetRow(_listView, 1);
            Children.Add(_listView);
        }
Exemplo n.º 2
0
        public DataGrid()
        {
            InitializeComponent();

            _sortingOrders = new Dictionary <int, SortingOrder>();

            _listView.ItemSelected += (s, e) =>
            {
                if (SelectionEnabled)
                {
                    SelectedItem = _listView.SelectedItem;
                }
                else
                {
                    _listView.SelectedItem = null;
                }

                ItemSelected?.Invoke(this, e);
            };

            _listView.Refreshing += (s, e) =>
            {
                Refreshing?.Invoke(this, e);
            };
        }
Exemplo n.º 3
0
 public void Refresh()
 {
     App.Current.Dispatcher.Invoke(() =>
     {
         Refreshing?.Invoke(this, new EventArgs());
     });
 }
Exemplo n.º 4
0
        void BeginRefreshing(bool isPulledRefresh)
        {
            var currentIconGeometryY       = _refreshIcon.Geometry.Y;
            var contentDistanceDiff        = _maximumDistance - currentIconGeometryY;
            var _refreshIconBeginAnimation = new Animation(v => _refreshIcon.Move(_refreshIcon.Geometry.X, currentIconGeometryY + (int)v), 0, contentDistanceDiff, Easing.Linear);

            _refreshIconBeginAnimation.Commit(this, "RefreshIconBegin", length: _animationLength);

            _refreshState          = RefreshState.Loading;
            _isRefreshing          = true;
            _refreshIcon.IsRunning = true;
            Refreshing?.Invoke(this, EventArgs.Empty);
        }
Exemplo n.º 5
0
 public static void Do(IHomeContentGetter getter = null)
 {
     lock (_lock)
     {
         getter = getter ?? new RemoteXamlReader();
         //开始刷新
         Refreshing?.Invoke(null, new HomeContentRefreshingEventArgs());
         //下载远端数据
         if (!getter.TryGet(out object result))
         {
             App.Current.Dispatcher.Invoke(() =>
             {
                 result = getter.Default();
             });
         }
         //刷新完成
         Refreshed?.Invoke(null, new HomeContentRefreshedEventArgs(result));
     }
 }
Exemplo n.º 6
0
 private void LvListView_Refreshing(object sender, EventArgs e)
 {
     Refreshing?.Invoke(this, e);
 }
Exemplo n.º 7
0
 void OnRefreshing(EventArgs e)
 => Refreshing?.Invoke(this, e);
 private void RaiseRefreshing()
 {
     IsRefreshing = true;
     Refreshing?.Invoke(this, EventArgs.Empty);
 }
Exemplo n.º 9
0
 internal static void OnRefreshing()
 {
     Refreshing?.Invoke(null, EventArgs.Empty);
 }