Ejemplo n.º 1
0
        private static void AddGridSplitterBindings(GridSplitter gridSplitter, DisplayContainer previousContainer, DisplayContainer nextContainer)
        {
            MultiBinding multiBinding = new MultiBinding()
            {
                Converter = new BooleanAndConverter()
            };

            // A splitter is disabled if either the container above or below it has its content collapsed
            var booleanToNotBooleanConverter = new BooleanToNotBooleanConverter();

            multiBinding.Bindings.Add(new Binding(nameof(previousContainer.IsContentCollapsed))
            {
                Source = previousContainer, Converter = booleanToNotBooleanConverter
            });
            multiBinding.Bindings.Add(new Binding(nameof(nextContainer.IsContentCollapsed))
            {
                Source = nextContainer, Converter = booleanToNotBooleanConverter
            });

            gridSplitter.SetBinding(GridSplitter.IsEnabledProperty, multiBinding);
        }
Ejemplo n.º 2
0
        private RowDefinition GetRowDefinitionForContainer(DisplayContainer container)
        {
            var row = Grid.GetRow(container);

            return(this.grid.RowDefinitions.ElementAt(row));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Add any bindings between the row and the DisplayContainer hosted in that row.
        /// </summary>
        private static void AddContainerRowDefinitionBindings(CollapsibleRowDefinition rowDefinitionForContainer, DisplayContainer displayContainer)
        {
            var isCollapsedBinding = new Binding()
            {
                Source = displayContainer,
                Path   = new PropertyPath(nameof(displayContainer.IsContentCollapsed))
            };

            BindingOperations.SetBinding(rowDefinitionForContainer, CollapsibleRowDefinition.IsCollapsedProperty, isCollapsedBinding);
        }