Skip to content

Commit

Permalink
side panels demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ButchersBoy committed Dec 8, 2015
1 parent cf32a7f commit d0d65f3
Show file tree
Hide file tree
Showing 28 changed files with 653 additions and 34 deletions.
10 changes: 5 additions & 5 deletions Common/Common.csproj
Expand Up @@ -34,18 +34,18 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dragablz, Version=0.0.2.122, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Dragablz, Version=0.0.2.143, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Dragablz.0.0.2.122\lib\net45\Dragablz.dll</HintPath>
<HintPath>..\packages\Dragablz.0.0.2.143\lib\net45\Dragablz.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.0.1.40, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="MahApps.Metro, Version=1.1.2.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MahApps.Metro.1.0.1-ALPHA040\lib\net45\MahApps.Metro.dll</HintPath>
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.0.1-ALPHA040\lib\net45\System.Windows.Interactivity.dll</HintPath>
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
Expand Down
4 changes: 2 additions & 2 deletions Common/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dragablz" version="0.0.2.122" targetFramework="net45" />
<package id="MahApps.Metro" version="1.0.1-ALPHA040" targetFramework="net45" />
<package id="Dragablz" version="0.0.2.143" targetFramework="net45" />
<package id="MahApps.Metro" version="1.1.2.0" targetFramework="net45" />
</packages>
6 changes: 6 additions & 0 deletions DragablzWindowApp.sln
Expand Up @@ -27,6 +27,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{2CFC29
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KeepWindowOpen", "KeepWindowOpen\KeepWindowOpen.csproj", "{9BE26F7F-8024-4182-86A0-8CC1B991276D}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SidePanels", "SidePanels\SidePanels.csproj", "{8766B9A7-E34B-4DFD-8C8A-2D46238C7189}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -57,6 +59,10 @@ Global
{9BE26F7F-8024-4182-86A0-8CC1B991276D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9BE26F7F-8024-4182-86A0-8CC1B991276D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9BE26F7F-8024-4182-86A0-8CC1B991276D}.Release|Any CPU.Build.0 = Release|Any CPU
{8766B9A7-E34B-4DFD-8C8A-2D46238C7189}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8766B9A7-E34B-4DFD-8C8A-2D46238C7189}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8766B9A7-E34B-4DFD-8C8A-2D46238C7189}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8766B9A7-E34B-4DFD-8C8A-2D46238C7189}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
10 changes: 5 additions & 5 deletions DragablzWindowApp/DragablzWindowApp.csproj
Expand Up @@ -36,18 +36,18 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dragablz, Version=0.0.2.122, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Dragablz, Version=0.0.2.143, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Dragablz.0.0.2.122\lib\net45\Dragablz.dll</HintPath>
<HintPath>..\packages\Dragablz.0.0.2.143\lib\net45\Dragablz.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.0.1.40, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="MahApps.Metro, Version=1.1.2.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MahApps.Metro.1.0.1-ALPHA040\lib\net45\MahApps.Metro.dll</HintPath>
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.0.1-ALPHA040\lib\net45\System.Windows.Interactivity.dll</HintPath>
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
Expand Down
4 changes: 2 additions & 2 deletions DragablzWindowApp/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dragablz" version="0.0.2.122" targetFramework="net45" />
<package id="MahApps.Metro" version="1.0.1-ALPHA040" targetFramework="net45" />
<package id="Dragablz" version="0.0.2.143" targetFramework="net45" />
<package id="MahApps.Metro" version="1.1.2.0" targetFramework="net45" />
</packages>
4 changes: 2 additions & 2 deletions KeepWindowOpen/KeepWindowOpen.csproj
Expand Up @@ -88,9 +88,9 @@
<Resource Include="readme.txt" />
</ItemGroup>
<ItemGroup>
<Reference Include="Dragablz, Version=0.0.2.122, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Dragablz, Version=0.0.2.143, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Dragablz.0.0.2.122\lib\net40\Dragablz.dll</HintPath>
<HintPath>..\packages\Dragablz.0.0.2.143\lib\net40\Dragablz.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework">
Expand Down
2 changes: 1 addition & 1 deletion KeepWindowOpen/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dragablz" version="0.0.2.122" targetFramework="net40" />
<package id="Dragablz" version="0.0.2.143" targetFramework="net40" />
</packages>
10 changes: 5 additions & 5 deletions MahAppsWindowApp/MahAppsWindowApp.csproj
Expand Up @@ -36,18 +36,18 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dragablz, Version=0.0.2.122, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Dragablz, Version=0.0.2.143, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Dragablz.0.0.2.122\lib\net45\Dragablz.dll</HintPath>
<HintPath>..\packages\Dragablz.0.0.2.143\lib\net45\Dragablz.dll</HintPath>
</Reference>
<Reference Include="MahApps.Metro, Version=1.0.1.40, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="MahApps.Metro, Version=1.1.2.0, Culture=neutral, PublicKeyToken=f4fb5a3c4d1e5b4f, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\MahApps.Metro.1.0.1-ALPHA040\lib\net45\MahApps.Metro.dll</HintPath>
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net45\MahApps.Metro.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\MahApps.Metro.1.0.1-ALPHA040\lib\net45\System.Windows.Interactivity.dll</HintPath>
<HintPath>..\packages\MahApps.Metro.1.1.2.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
Expand Down
4 changes: 2 additions & 2 deletions MahAppsWindowApp/packages.config
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dragablz" version="0.0.2.122" targetFramework="net45" />
<package id="MahApps.Metro" version="1.0.1-ALPHA040" targetFramework="net45" />
<package id="Dragablz" version="0.0.2.143" targetFramework="net45" />
<package id="MahApps.Metro" version="1.1.2.0" targetFramework="net45" />
</packages>
4 changes: 2 additions & 2 deletions OptionalCloseButton/OptionalCloseButton.csproj
Expand Up @@ -54,9 +54,9 @@
<StartupObject>OptionalCloseButton.Boot</StartupObject>
</PropertyGroup>
<ItemGroup>
<Reference Include="Dragablz, Version=0.0.2.122, Culture=neutral, processorArchitecture=MSIL">
<Reference Include="Dragablz, Version=0.0.2.143, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\Dragablz.0.0.2.122\lib\net45\Dragablz.dll</HintPath>
<HintPath>..\packages\Dragablz.0.0.2.143\lib\net45\Dragablz.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
2 changes: 1 addition & 1 deletion OptionalCloseButton/packages.config
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Dragablz" version="0.0.2.122" targetFramework="net45" />
<package id="Dragablz" version="0.0.2.143" targetFramework="net45" />
</packages>
26 changes: 26 additions & 0 deletions SidePanels/App.xaml
@@ -0,0 +1,26 @@
<Application x:Class="SidePanels.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz"
xmlns:sidePanels="clr-namespace:SidePanels"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
<ResourceDictionary Source="pack://application:,,,/Dragablz;component/Themes/materialdesign.xaml" />
</ResourceDictionary.MergedDictionaries>
<dragablz:InterTabController x:Key="InterTabController" x:Shared="False" MoveWindowWithSolitaryTabs="False">
<dragablz:InterTabController.InterTabClient>
<sidePanels:MyInterTabClient />
</dragablz:InterTabController.InterTabClient>
</dragablz:InterTabController>
<Style TargetType="dragablz:TabablzControl" BasedOn="{StaticResource MaterialDesignTabablzControlStyle}">
<Setter Property="InterTabController" Value="{StaticResource InterTabController}" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>
16 changes: 16 additions & 0 deletions SidePanels/App.xaml.cs
@@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace SidePanels
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
16 changes: 16 additions & 0 deletions SidePanels/ChildWindow.xaml
@@ -0,0 +1,16 @@
<Window x:Class="SidePanels.ChildWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz"
xmlns:sidePanels="clr-namespace:SidePanels"
Title="ChildWindow" Height="300" Width="300">
<dragablz:TabablzControl x:Name="ChildWindowTabablzControl">
<dragablz:TabablzControl.InterTabController>
<dragablz:InterTabController MoveWindowWithSolitaryTabs="True">
<dragablz:InterTabController.InterTabClient>
<sidePanels:MyInterTabClient />
</dragablz:InterTabController.InterTabClient>
</dragablz:InterTabController>
</dragablz:TabablzControl.InterTabController>
</dragablz:TabablzControl>
</Window>
27 changes: 27 additions & 0 deletions SidePanels/ChildWindow.xaml.cs
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace SidePanels
{
/// <summary>
/// Interaction logic for ChildWindow.xaml
/// </summary>
public partial class ChildWindow : Window
{
public ChildWindow()
{
InitializeComponent();
}
}
}
59 changes: 59 additions & 0 deletions SidePanels/MainWindow.xaml
@@ -0,0 +1,59 @@
<Window x:Class="SidePanels.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:dockablz="http://dragablz.net/winfx/xaml/dockablz"
xmlns:dragablz="http://dragablz.net/winfx/xaml/dragablz"
Title="MainWindow" Height="350" Width="525">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Dragablz;component/Themes/materialdesign.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="SideTabItemStyle" TargetType="{x:Type dragablz:DragablzItem}" BasedOn="{StaticResource MaterialDesignDragableTabItemVerticalStyle}">
<Setter Property="Width" Value="40" />
</Style>
</ResourceDictionary>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" x:Name="LeftPanelColumnDefinition" />
<ColumnDefinition Width="4" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>

<!-- left panel make sure you configure exactly, and set up the IsEmptyChanged event -->
<dragablz:TabablzControl x:Name="LeftPanelTabControl"
TabStripPlacement="Left"
ItemContainerStyle="{StaticResource SideTabItemStyle}"
dragablz:DragablzItem.ContentRotateTransformAngle="90"
IsEmptyChanged="LeftPanelTabControl_OnIsEmptyChanged">
<TabItem Header="AAA">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16" >Tab Page A</TextBlock>
</TabItem>
<TabItem Header="BBB">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16">Tab Page B</TextBlock>
</TabItem>
<TabItem Header="CCC">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16">Tab Page C</TextBlock>
</TabItem>
</dragablz:TabablzControl>

<GridSplitter Grid.Column="1" ResizeDirection="Columns" ResizeBehavior="PreviousAndNext" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />

<!-- Layout is optional, you could just have a TabablzControl -->
<dockablz:Layout Grid.Column="2">
<dragablz:TabablzControl>
<TabItem Header="One">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16">Tab Page One</TextBlock>
</TabItem>
<TabItem Header="Two">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16">Tab Page Two</TextBlock>
</TabItem>
<TabItem Header="Three">
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="16">Tab Page Three</TextBlock>
</TabItem>
</dragablz:TabablzControl>
</dockablz:Layout>

</Grid>
</Window>
33 changes: 33 additions & 0 deletions SidePanels/MainWindow.xaml.cs
@@ -0,0 +1,33 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SidePanels
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}

private void LeftPanelTabControl_OnIsEmptyChanged(object sender, RoutedPropertyChangedEventArgs<bool> e)
{
if (e.NewValue)
LeftPanelColumnDefinition.Width = GridLength.Auto;
}
}
}
26 changes: 26 additions & 0 deletions SidePanels/MyInterTabController.cs
@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Media;
using Dragablz;

namespace SidePanels
{
public class MyInterTabClient : IInterTabClient
{
public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source)
{
var childWindow = new ChildWindow();

return new NewTabHost<Window>(childWindow, childWindow.ChildWindowTabablzControl);
}

public TabEmptiedResponse TabEmptiedHandler(TabablzControl tabControl, Window window)
{
return window is MainWindow ? TabEmptiedResponse.DoNothing : TabEmptiedResponse.CloseWindowOrLayoutBranch;
}
}
}

0 comments on commit d0d65f3

Please sign in to comment.