コード例 #1
0
        private void ToggleDetailControlAnimation()
        {
            DetailControl.CurrentImage = _clickedImg;
            DetailControl.Show(_clickedContainer);

            NavigationService.AddOperation(() =>
            {
                DetailControl.Hide();
                return(true);
            });
        }
コード例 #2
0
        public void DetailControlTest()
        {
            using (var dt = new DataTable())
            {
                dt.Columns.Add(new DataColumn
                {
                    ColumnName = "ID",
                    DataType   = typeof(int)
                });
                dt.Columns.Add(new DataColumn
                {
                    ColumnName = "Text",
                    DataType   = typeof(string)
                });
                dt.Columns.Add(new DataColumn
                {
                    ColumnName = "Date",
                    DataType   = typeof(DateTime)
                });
                dt.Columns.Add(new DataColumn
                {
                    ColumnName = "Bool",
                    DataType   = typeof(bool)
                });
                for (var line = 1; line < 5000; line++)
                {
                    var row = dt.NewRow();
                    row[0] = line;
                    row[1] = $"This is text {line / 2}";
                    row[2] = new DateTime(2001, 6, 6).AddHours(line * 3);
                    row[3] = line % 3 == 0;
                    if (SecureString.Random.Next(1, 10) == 5)
                    {
                        row.SetColumnError(SecureString.Random.Next(0, 3), "Error");
                    }
                    if (SecureString.Random.Next(1, 50) == 5)
                    {
                        row.RowError = "Row Error";
                    }
                    dt.Rows.Add(row);
                }

                using (var dc = new DetailControl())
                {
                    dc.Show();
                    dc.DataTable = dt;
                    dc.OnlyShowErrors();
                    dc.MoveMenu();
                }
            }
        }
コード例 #3
0
        public async System.Threading.Tasks.Task DetailControlTestAsync()
        {
            using (var dt = new DataTable())
            {
                dt.Columns.Add(new DataColumn {
                    ColumnName = "ID", DataType = typeof(int)
                });
                dt.Columns.Add(new DataColumn {
                    ColumnName = "Text", DataType = typeof(string)
                });
                dt.Columns.Add(new DataColumn {
                    ColumnName = "Date", DataType = typeof(DateTime)
                });
                dt.Columns.Add(new DataColumn {
                    ColumnName = "Bool", DataType = typeof(bool)
                });
                for (var line = 1; line < 5000; line++)
                {
                    var row = dt.NewRow();
                    row[0] = line;
                    row[1] = $"This is text {line / 2}";
                    row[2] = new DateTime(2001, 6, 6).AddHours(line * 3);
                    row[3] = line % 3 == 0;
                    if (random.Next(1, 10) == 5)
                    {
                        row.SetColumnError(random.Next(0, 3), "Error");
                    }
                    if (random.Next(1, 50) == 5)
                    {
                        row.RowError = "Row Error";
                    }
                    dt.Rows.Add(row);
                }

                using (var dc = new DetailControl())
                {
                    dc.HTMLStyle = UnitTestInitializeWin.HTMLStyle;
                    dc.Show();
                    dc.DataTable = dt;

                    await dc.RefreshDisplayAsync(FilterType.All, UnitTestInitializeCsv.Token);

                    dc.OnlyShowErrors = true;
                    dc.MoveMenu();
                }
            }
        }
コード例 #4
0
        private void ToggleDetailControlAnimation()
        {
            DetailControl.CurrentImage = _clickedImg;
            DetailControl.Show(_clickedContainer);

            var key = (string)App.Current.Resources["GestureKey"];

            if (!LocalSettingHelper.HasValue(key))
            {
                ToggleGestureTipsControlAnimation(true, 500);
            }

            NavigationService.AddOperation(() =>
            {
                DetailControl.Hide();
                return(true);
            });
        }
コード例 #5
0
        public void SortTest()
        {
            using (var dt = new DataTable())
            {
                dt.Columns.Add(new DataColumn
                {
                    ColumnName = "ID",
                    DataType   = typeof(int)
                });
                dt.Columns.Add(new DataColumn
                {
                    ColumnName = "Text",
                    DataType   = typeof(string)
                });
                dt.Columns.Add(new DataColumn
                {
                    ColumnName = "Date",
                    DataType   = typeof(DateTime)
                });
                dt.Columns.Add(new DataColumn
                {
                    ColumnName = "Bool",
                    DataType   = typeof(bool)
                });
                for (var line = 1; line < 5000; line++)
                {
                    var row = dt.NewRow();
                    row[0] = SecureString.Random.Next(1, 5000);
                    row[1] = $"This is text {line / 2}";
                    row[2] = new DateTime(2001, 6, 6).AddHours(line * 3);
                    row[3] = line % 3 == 0;
                    dt.Rows.Add(row);
                }

                using (var dc = new DetailControl())
                {
                    dc.Show();
                    dc.DataTable = dt;
                    dc.Sort("ID", ListSortDirection.Ascending);
                }
            }
        }
コード例 #6
0
        public async System.Threading.Tasks.Task SortTestAsync()
        {
            using (var dt = new DataTable())
            {
                dt.Columns.Add(new DataColumn {
                    ColumnName = "ID", DataType = typeof(int)
                });
                dt.Columns.Add(new DataColumn {
                    ColumnName = "Text", DataType = typeof(string)
                });
                dt.Columns.Add(new DataColumn {
                    ColumnName = "Date", DataType = typeof(DateTime)
                });
                dt.Columns.Add(new DataColumn {
                    ColumnName = "Bool", DataType = typeof(bool)
                });
                for (var line = 1; line < 5000; line++)
                {
                    var row = dt.NewRow();
                    row[0] = random.Next(1, 5000);
                    row[1] = $"This is text {line / 2}";
                    row[2] = new DateTime(2001, 6, 6).AddHours(line * 3);
                    row[3] = line % 3 == 0;
                    dt.Rows.Add(row);
                }

                using (var dc = new DetailControl())
                {
                    dc.HTMLStyle = UnitTestInitializeWin.HTMLStyle;
                    dc.Show();
                    dc.DataTable = dt;
                    await dc.RefreshDisplayAsync(FilterType.All, UnitTestInitializeCsv.Token);

                    dc.Sort("ID", ListSortDirection.Ascending);
                }
            }
        }
コード例 #7
0
        private void ToggleDetailControlAnimation()
        {
            var position  = DetailControl.GetTargetPosition();
            var titleRect = TitleStack.TransformToVisual(Window.Current.Content)
                            .TransformBounds(new Rect(0, 0, TitleStack.ActualWidth, TitleStack.ActualHeight));
            var clickedItemRect = _clickedContainer.TransformToVisual(Window.Current.Content)
                                  .TransformBounds(new Rect(0, 0, _clickedContainer.ActualWidth, _clickedContainer.ActualHeight));

            titleRect.Intersect(clickedItemRect);
            if (!titleRect.IsEmpty)
            {
                _restoreTitleStackStatus = true;
                ToggleTitleStackAnimation(false);
            }

            DetailControl.CurrentImage = _clickedImg;
            DetailControl.Show(_clickedContainer);

            NavigationService.AddOperation(() =>
            {
                DetailControl.Hide();
                return(true);
            });
        }
コード例 #8
0
 private void GalleryGridViewControl_OnClickItemStarted(ImageViewModel imageViewModel)
 {
     DetailControl.PhotoDetailImageViewModel = imageViewModel;
     DetailControl.Visibility = Visibility.Visible;
     DetailControl.Show();
 }