Beispiel #1
0
        public void GenerateEditingElementBinding()
        {
            TestHelper.RunInUIhread(() =>
            {
                var dataGridColumn     = new DataGridFileSystemSelectionColumnMock();
                dataGridColumn.Binding = CreateBinding(new BindableValue <string>("42"));

                var fileFilter = new BindableValue <string>(string.Empty);
                dataGridColumn.FileFilterBinding = CreateBinding(fileFilter);

                var mode = new BindableValue <FileSystemSelectionControl.SelectionMode>(
                    FileSystemSelectionControl.SelectionMode.ExistingFileSelection);
                dataGridColumn.ModeBinding = CreateBinding(mode);

                var control = (FileSystemSelectionControl)
                              dataGridColumn.GenerateEditingElementPublic(
                    new DataGridCell(), null);

                fileFilter.Value = "fileFilter";
                mode.Value       = FileSystemSelectionControl.SelectionMode.FolderSelection;

                Assert.AreEqual(fileFilter.Value, control.FileFilter);
                Assert.AreEqual(mode.Value, control.Mode);
            });
        }
Beispiel #2
0
        public void GenerateEditingElementConstantBindings()
        {
            TestHelper.RunInUIhread(() =>
            {
                var dataGridColumn = new DataGridFileSystemSelectionColumnMock();
                var str            = new BindableValue <string>("42");

                dataGridColumn.Binding    = CreateBinding(str);
                dataGridColumn.FileFilter = "filter";
                dataGridColumn.Mode       = FileSystemSelectionControl.SelectionMode.FolderSelection;
                var cell    = new DataGridCell();
                var control = (FileSystemSelectionControl)
                              dataGridColumn.GenerateEditingElementPublic(
                    cell, null);
                Assert.AreEqual(dataGridColumn.FileFilter, control.FileFilter);
                Assert.AreEqual(dataGridColumn.Mode, control.Mode);
                Assert.AreEqual(str.Value, control.SelectedPath);
                Assert.AreEqual(str.Value, cell.ToolTip);
            });
        }