private void blockClicked(object sender, RoutedEventArgs e)
        {
            var toggle = sender as ToggleButton;
            var block  = vm.GetBlockById((int)toggle.Tag);

            if (Keyboard.Modifiers == ModifierKeys.Control)
            {
                block.Selected = !block.Selected;
            }
            else
            {
                vm.DeselectAll();
                block.Selected = true;
            }

            vm.CurrentBlock = vm.SelectedBlocks.LastOrDefault();
            if (vm.CurrentBlock == null)
            {
                return;
            }

            if (vm.CurrentBlock.Page != null)
            {
                BlockInfo.Content = vm.CurrentBlock.Page; // Display the Block Info page
            }
            labelTextbox.Text = vm.CurrentBlock.Block.Label;
        }
Example #2
0
        private void blockClicked(object sender, RoutedEventArgs e)
        {
            var toggle = sender as ToggleButton;
            var block  = vm.GetBlockById((int)toggle.Tag);

            if (Keyboard.Modifiers == ModifierKeys.Control)
            {
                block.Selected = !block.Selected;
            }
            else
            {
                vm.DeselectAll();
                block.Selected = true;
            }

            try { blockInfoScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; } catch { }

            if ((vm.CurrentBlock = vm.SelectedBlocks.LastOrDefault()) == null)
            {
                return;
            }

            if (vm.CurrentBlock.Page != null)
            {
                BlockInfo.Content = vm.CurrentBlock.Page; // Display the Block Info page
            }
            Keyboard.ClearFocus();

            if (vm.CurrentBlock.Page.Title == "PageBlockKeycheck")
            {
                blockInfoScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled;
            }

            labelTextbox.Text = vm.CurrentBlock.Block.Label;
        }