Set BlockGroupBrowser pane to not be closeable

This commit is contained in:
Ben 2015-06-22 21:00:13 +01:00
parent 692269ddb3
commit 0eafd59e79
8 changed files with 57 additions and 40 deletions

View File

@ -102,6 +102,9 @@
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010">
<HintPath>..\packages\AvalonDock.2.0.2000\lib\net40\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2013">
<HintPath>.\Xceed.Wpf.AvalonDock.Themes.VS2013.dll</HintPath>
</Reference>
<Reference Include="Xceed.Wpf.Toolkit, Version=2.4.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Extended.Wpf.Toolkit.2.4\lib\net40\Xceed.Wpf.Toolkit.dll</HintPath>

View File

@ -1,5 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using Filtration.Models;
using Filtration.Services;

View File

@ -91,7 +91,7 @@ namespace Filtration.ViewModels
public ItemFilterBlock Block { get; private set; }
public bool IsDirty { get; set; }
public ObservableCollection<IItemFilterBlockItem> FilterBlockItems
public ObservableCollection<IItemFilterBlockItem> BlockItems
{
get { return Block.BlockItems; }
}
@ -226,7 +226,7 @@ namespace Filtration.ViewModels
get
{
return HasTextColor
? FilterBlockItems.OfType<TextColorBlockItem>().First().Color
? BlockItems.OfType<TextColorBlockItem>().First().Color
: new Color { A = 255, R = 255, G = 255, B = 255 };
}
}
@ -241,7 +241,7 @@ namespace Filtration.ViewModels
get
{
return HasBackgroundColor
? FilterBlockItems.OfType<BackgroundColorBlockItem>().First().Color
? BlockItems.OfType<BackgroundColorBlockItem>().First().Color
: new Color { A = 255, R = 0, G = 0, B = 0 };
}
}
@ -256,7 +256,7 @@ namespace Filtration.ViewModels
get
{
return HasBorderColor
? FilterBlockItems.OfType<BorderColorBlockItem>().First().Color
? BlockItems.OfType<BorderColorBlockItem>().First().Color
: new Color { A = 255, R = 0, G = 0, B = 0 };
}
}
@ -285,13 +285,13 @@ namespace Filtration.ViewModels
if (!AddBlockItemAllowed(blockItemType)) return;
var newBlockItem = (IItemFilterBlockItem) Activator.CreateInstance(blockItemType);
FilterBlockItems.Add(newBlockItem);
BlockItems.Add(newBlockItem);
IsDirty = true;
}
private void OnRemoveFilterBlockItemCommand(IItemFilterBlockItem blockItem)
{
FilterBlockItems.Remove(blockItem);
BlockItems.Remove(blockItem);
IsDirty = true;
}
@ -301,7 +301,7 @@ namespace Filtration.ViewModels
var newBlockItem = (IItemFilterBlockItem) Activator.CreateInstance(blockItemType);
newBlockItem.PropertyChanged += OnAudioVisualBlockItemChanged;
FilterBlockItems.Add(newBlockItem);
BlockItems.Add(newBlockItem);
OnAudioVisualBlockItemChanged(null, null);
IsDirty = true;
}
@ -309,7 +309,7 @@ namespace Filtration.ViewModels
private void OnRemoveAudioVisualBlockItemCommand(IItemFilterBlockItem blockItem)
{
blockItem.PropertyChanged -= OnAudioVisualBlockItemChanged;
FilterBlockItems.Remove(blockItem);
BlockItems.Remove(blockItem);
OnAudioVisualBlockItemChanged(null, null);
IsDirty = true;
}
@ -370,13 +370,13 @@ namespace Filtration.ViewModels
private bool AddBlockItemAllowed(Type type)
{
var blockItem = (IItemFilterBlockItem)Activator.CreateInstance(type);
var blockCount = FilterBlockItems.Count(b => b.GetType() == type);
var blockCount = BlockItems.Count(b => b.GetType() == type);
return blockCount < blockItem.MaximumAllowed;
}
private void OnPlaySoundCommand()
{
var soundUri = "Resources/AlertSounds/AlertSound" + FilterBlockItems.OfType<SoundBlockItem>().First().Value + ".wav";
var soundUri = "Resources/AlertSounds/AlertSound" + BlockItems.OfType<SoundBlockItem>().First().Value + ".wav";
_mediaPlayer.Open(new Uri(soundUri, UriKind.Relative));
_mediaPlayer.Play();
}

View File

@ -71,14 +71,18 @@
</viewsAvalonDock:PanesStyleSelector.DocumentStyle>
</viewsAvalonDock:PanesStyleSelector>
</xcad:DockingManager.LayoutItemContainerStyleSelector>
<xcad:DockingManager.LayoutUpdateStrategy>
<viewsAvalonDock:LayoutInitializer></viewsAvalonDock:LayoutInitializer>
<viewsAvalonDock:LayoutInitializer />
</xcad:DockingManager.LayoutUpdateStrategy>
<xcad:LayoutRoot>
<xcad:LayoutPanel Orientation="Horizontal">
<xcad:LayoutAnchorablePane Name="SectionBrowserPane" DockWidth="150" />
<xcad:LayoutPanel Orientation="Vertical">
<xcad:LayoutDocumentPane />
<xcad:LayoutAnchorablePane Name="BlockOutputPreviewPane" DockHeight="100" />
</xcad:LayoutPanel>
<xcad:LayoutAnchorablePane Name="BlockGroupBrowserPane" DockWidth="200" />
</xcad:LayoutPanel>
</xcad:LayoutRoot>

View File

@ -26,32 +26,19 @@ namespace Filtration.Views.AvalonDock
return true;
}
}
//if (anchorableToShow.ContentId == "SectionBrowserTool")
//{
// var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "SectionBrowserPane");
// if (toolsPane != null)
// {
// anchorableToShow.CanHide = false;
// toolsPane.Children.Add(anchorableToShow);
// return true;
// }
//}
//if (anchorableToShow.ContentId == "BlockGroupBrowserTool")
//{
// var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "BlockGroupBrowserPane");
// if (toolsPane != null)
// {
// anchorableToShow.CanHide = false;
// toolsPane.Children.Add(anchorableToShow);
// return true;
// }
//}
if (anchorableToShow.Content is BlockGroupBrowserViewModel)
{
var toolsPane = layout.Descendents().OfType<LayoutAnchorablePane>().FirstOrDefault(d => d.Name == "BlockGroupBrowserPane");
if (toolsPane != null)
{
anchorableToShow.CanHide = false;
toolsPane.Children.Add(anchorableToShow);
return true;
}
}
return false;
}

View File

@ -38,7 +38,7 @@
<ToolTip Visibility="{Binding AdvancedBlockGroup, Converter={StaticResource BooleanVisibilityConverter}}">Advanced Block Group</ToolTip>
</Rectangle.ToolTip>
</Rectangle>
<Expander Grid.Column="1" Style="{StaticResource ExpanderRightAlignStyle}" x:Name="TestExpander" ToolTip="{Binding BlockDescription}" ToolTipService.IsEnabled="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsExpanded, Converter={StaticResource BoolInverterConverter}}">
<Expander Grid.Column="1" Style="{StaticResource ExpanderRightAlignStyle}" x:Name="BlockExpander" MouseDoubleClick="BlockExpander_OnMouseDoubleClick" ToolTip="{Binding BlockDescription}" ToolTipService.IsEnabled="{Binding RelativeSource={RelativeSource Mode=Self}, Path=IsExpanded, Converter={StaticResource BoolInverterConverter}}">
<Expander.ContextMenu>
<ContextMenu>
<ContextMenu.Items>
@ -121,7 +121,7 @@
</Popup>
</Grid>
</Expander.Header>
<Grid Margin="10,5,10,5">
<Grid Margin="10,5,10,5" x:Name="BlockItemsGrid">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
@ -148,7 +148,7 @@
<!-- Block Items -->
<WrapPanel Grid.Row="1" MaxHeight="200">
<ItemsControl ItemsSource="{Binding FilterBlockItems}">
<ItemsControl ItemsSource="{Binding BlockItems}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel Orientation="Vertical" />

View File

@ -1,4 +1,7 @@
namespace Filtration.Views
using System.Windows.Controls;
using System.Windows.Input;
namespace Filtration.Views
{
public partial class ItemFilterBlockView
{
@ -6,5 +9,16 @@
{
InitializeComponent();
}
private void BlockExpander_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
{
var originalSource = e.OriginalSource as System.Windows.Media.Visual;
if (originalSource != null && originalSource.IsDescendantOf(BlockItemsGrid))
{
return;
}
BlockExpander.IsExpanded = !BlockExpander.IsExpanded;
}
}
}

View File

@ -0,0 +1,10 @@
namespace Filtration.Views.ToolPanes
{
public partial class SectionBrowserView
{
public SectionBrowserView()
{
InitializeComponent();
}
}
}