This commit is contained in:
2026-04-17 14:55:32 -04:00
commit bc3ac1d4c9
18017 changed files with 4371742 additions and 0 deletions

View File

@@ -0,0 +1,332 @@
<base:BaseView x:Class="DTS.Viewer.ExportMainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="http://prismlibrary.com/"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:interactivity="clr-namespace:DTS.Common.Interactivity;assembly=DTS.Common"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<base:BaseView.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:WidthConverter x:Key="WidthConverter" />
</base:BaseView.Resources>
<i:Interaction.Triggers>
<interactivity:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactivity:InteractionRequestTrigger>
</i:Interaction.Triggers>
<toolkit:BusyIndicator IsBusy="{Binding IsBusy, UpdateSourceTrigger=PropertyChanged}" BusyContent="{Binding IsBusyMessage}" Visibility="Visible" >
<DockPanel x:Name="MainShell" FlowDirection="LeftToRight" LastChildFill="True" SnapsToDevicePixels="True" WindowChrome.ResizeGripDirection="TopLeft" >
<dock:DockingManager Name="DockManager" BorderBrush="Black" BorderThickness="1" AllowMixedOrientation="True" Style="{DynamicResource {x:Type dock:DockingManager}}"
ShowSystemMenu="False" UseLayoutRounding="False" IsManipulationEnabled="True"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" >
<dock:DockingManager.Resources>
<Style TargetType="{x:Type dock:LayoutDocumentTabItem}">
<Setter Property="Width" Value="100" />
</Style>
</dock:DockingManager.Resources>
<dock:DockingManager.Theme>
<dock:AeroTheme/>
</dock:DockingManager.Theme>
<dock:DockingManager.AnchorablePaneControlStyle>
<Style TargetType="{x:Type dock:LayoutAnchorablePaneControl}" >
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="TabStripPlacement" Value="Top"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="{Binding Model.Root.Manager.Foreground, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Background" Value="{Binding Model.Root.Manager.Background, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dock:LayoutAnchorablePaneControl}">
<Grid x:Name="grid" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Background="Transparent" Grid.RowSpan="2"/>
<Border Grid.Row="0" x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Cycle"/>
<dock:AnchorablePaneTabPanel Grid.Row="0" x:Name="HeaderPanel" Margin="0,0,2,2" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
<Grid Grid.Row="1">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource Self}}" Value="1">
<Setter Property="Margin" Value="0" TargetName="HeaderPanel"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="{x:Type TabItem}" >
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor4, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor5, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor12, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="ToolTip" Value="{Binding ToolTip}"/>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid SnapsToDevicePixels="True">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentSource="Header" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor2, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor3, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="1"/>
<Setter Property="Margin" Value="0,0,0,0"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor32, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor27, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="0"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor13, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor9, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="1">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableTabItem Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableControl Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</dock:DockingManager.AnchorablePaneControlStyle>
<dock:LayoutRoot x:Name="_layoutRoot" >
<dock:LayoutPanel Orientation="Horizontal" IsMaximized="True" DockHeight="*" >
<dock:LayoutAnchorablePane Name="NavigationPane" DockWidth="250" DockHeight="*">
<dock:LayoutAnchorable ContentId="NavigationRegionPanel" IsMaximized="True" AutoHideWidth="100" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="NavigationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}"
Width="250" VerticalAlignment="Stretch" HorizontalAlignment="Left">
<ContentControl.Template >
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Left"/>
<ContentPresenter Content="{TemplateBinding Content}" MinWidth="240" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutPanel Orientation="Vertical" IsMaximized="True" DockHeight="*" DockWidth="Auto">
<dock:LayoutAnchorablePane Name="GraphPane" DockWidth="*" DockHeight="*">
<dock:LayoutAnchorable CanAutoHide="False" CanClose="False" CanHide="False">
<ContentControl x:Name="GraphRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphsRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Height="Auto" Width="Auto" MinHeight="500" MinWidth="500">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutAnchorablePane Name="TestPane" DockMinHeight="100" DockWidth="*" DockHeight="*" >
<dock:LayoutAnchorable ContentId="TestRegionPanel" x:Name="TestRegionPanel" Title="Tests" CanClose="False" CanHide="False" IsVisible="False" CanAutoHide="True" CanFloat="True" >
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestsRegion}"
Width="{Binding Path=ActualWidth, ElementName=TestPane, Converter={StaticResource WidthConverter}, ConverterParameter='1'}"
Height="{Binding Path=ActualHeight, ElementName=TestPane, Converter={StaticResource WidthConverter}, ConverterParameter='1'}"
VerticalAlignment="Top" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="GraphRegionPanel" x:Name="GraphListPanel" Title="Graphs" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True">
<ContentControl x:Name="GraphListRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphListRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<!--<dock:LayoutAnchorable ContentId="SettingsRegionPanel" x:Name="SettingsPanel" Title="Settings" CanClose="False" CanHide="True" IsVisible="False" CanAutoHide="True" CanFloat="True">
<ContentControl x:Name="SettingsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerSettingsRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="LegendRegionPanel" Title="Legend" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True">
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>-->
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
<dock:LayoutPanel Orientation="Vertical" DockWidth="320" DockMinWidth="300" DockHeight="Auto" >
<dock:LayoutAnchorablePane Name="DiagnosticPane" DockWidth="300" DockMinWidth="300" DockHeight="*" IsMaximized="True" >
<dock:LayoutAnchorable ContentId="DiagRegionPanel" Title="Diag" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="DiagRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerDiagRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="StatsRegionPanel" Title="Stats" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="StatsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerStatsRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="CursorRegionPanel" Title="Cursor" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="CursorRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerCursorRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutAnchorablePane Name="ModificationPane" DockWidth="300" DockMinWidth="300" DockHeight="*" IsMaximized="True" >
<dock:LayoutAnchorable ContentId="ChartOptionsPanel" Title="Display" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="ChartOptionsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerChartOptionsRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="ModifyRegionPanel" Title="Modify" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="TestModificationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestModificationRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="AddRegionPanel" Title="Add" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="AddRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyAddRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
</dock:LayoutPanel>
</dock:LayoutRoot>
</dock:DockingManager>
<!--</Grid>-->
</DockPanel>
</toolkit:BusyIndicator>
</base:BaseView>

View File

@@ -0,0 +1,25 @@
using DTS.Common.Interface;
// ReSharper disable CheckNamespace
// ReSharper disable ArrangeTypeMemberModifiers
// ReSharper disable UnusedMember.Local
// ReSharper disable UnusedParameter.Local
// ReSharper disable RedundantDefaultMemberInitializer
// ReSharper disable ConvertClosureToMethodGroup
// ReSharper disable PossibleNullReferenceException
namespace DTS.Viewer
{
/// <summary>
/// Interaction logic for ExportMainView.xaml
/// </summary>
public partial class ExportMainView : IExportMainView
{
public ExportMainView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,140 @@
<base:BaseView x:Class="DTS.Viewer.ExportMainViewGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:strings="clr-namespace:DTS.Viewer"
xmlns:interactionRequest="clr-namespace:DTS.Common.Interactivity;assembly=DTS.Common"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<Grid x:Name="MainShell" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" UseLayoutRounding="True" SnapsToDevicePixels="True" >
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="testsColumn" Width="310" />
<ColumnDefinition x:Name="separatorColumn" Width="5" />
<ColumnDefinition x:Name="graphsColumn" Width="*" />
<ColumnDefinition x:Name="optionsColumn" Width="310" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Nav-->
<Grid Grid.Column="0" Grid.Row="0" Visibility="Collapsed" >
<ContentControl x:Name="NavigationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Left" Visibility="Collapsed">
<ContentControl.Template >
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Left"/>
<ContentPresenter Content="{TemplateBinding Content}" MinWidth="240" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</Grid>
<!-- FB12164, a repurposed FB11709 -->
<ToggleButton Grid.Column="0" Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Right" Panel.ZIndex="140" FontSize="8" AutomationProperties.AutomationId="btnCollapseNavPanel"
Height="15" Width="15" Background="{StaticResource Brush_ApplicationContentBackground}" Content="&lt;&lt;">
<ToggleButton.Triggers>
<EventTrigger RoutedEvent="ToggleButton.Unchecked">
<BeginStoryboard>
<Storyboard x:Name="ShowTabPanel">
<controls:GridLengthAnimation Storyboard.TargetName="testsColumn" Storyboard.TargetProperty="Width" From="15" Duration="0:0:0.1" FillBehavior="Stop" />
<DoubleAnimation Storyboard.TargetName="graphSelectionTabPane" Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:0.1" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Content">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="&lt;&lt;" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="ToggleButton.Checked">
<BeginStoryboard>
<Storyboard x:Name="HideTabPanel">
<controls:GridLengthAnimation Storyboard.TargetName="testsColumn" Storyboard.TargetProperty="Width" To="15" Duration="0:0:0.1" />
<DoubleAnimation Storyboard.TargetName="graphSelectionTabPane" Storyboard.TargetProperty="Opacity" From="1.0" To="0.0" Duration="0:0:0.1" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Content">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="&gt;&gt;" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ToggleButton.Triggers>
</ToggleButton>
<TabControl x:Name="graphSelectionTabPane" Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AutomationProperties.AutomationId="GraphSelectionTabPane">
<TabItem x:Name="testsTab" Visibility ="Hidden" Header="{Binding Path=TitleTests}" AutomationProperties.AutomationId="TestsTab">
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestsRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem x:Name="graphsTab" Header="{Binding Path=TitleGraphs}" AutomationProperties.AutomationId="GraphsTab">
<ContentControl x:Name="GraphListRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphListRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem Header="Legend" Visibility="Collapsed" AutomationProperties.AutomationId="LegendTab">
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
</TabControl>
<GridSplitter Grid.Row="0" Grid.Column="1" VerticalAlignment="Stretch" Width="5" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns"/>
<!-- Graph -->
<ContentControl Grid.Column="2" Grid.Row="0" x:Name="GraphRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphsRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</Grid>
</base:BaseView>

View File

@@ -0,0 +1,89 @@
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interface;
using System;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using C1.WPF.Pdf;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Windows.Media;
using DTS.Common.Utilities.Logging;
using Prism.Events;
using Prism.Ioc;
// ReSharper disable CheckNamespace
namespace DTS.Viewer
{
/// <summary>
/// Interaction logic for ViewerMainViewGrid.xaml
/// </summary>
public partial class ExportMainViewGrid : IExportMainViewGrid
{
public ExportMainViewGrid()
{
InitializeComponent();
Loaded += ExportMainViewGrid_Loaded;
}
private IEventAggregator _eventAggregator { get; set; }
private void SetFocus()
{
}
//FB 14797 Subscribe to event after the page loaded to make sure eventAggregator is available
private void ExportMainViewGrid_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
_eventAggregator = ContainerLocator.Container.Resolve<IEventAggregator>();
_eventAggregator?.GetEvent<GraphLoadedCountNotification>().Subscribe(OnGraphLoadedCountNotification);
}
//FB 14797 Set the focus to first tab (chartOptTab) after the graph is fully loaded (3 sec)
private void OnGraphLoadedCountNotification(GraphLoadedCountNotificationArg arg)
{
if (null != DataContext && (IBaseViewModel)DataContext != arg.ParentVM) return;
Task.Run(() =>
{
Thread.Sleep(TimeSpan.FromSeconds(3));
Dispatcher.BeginInvoke((System.Action)SetFocus);
});
}
/// <summary>
/// Returns > 0 if successful, < 0 if failure, or 0 if the MainChart is not ready yet
/// </summary>
/// <param name="directory"></param>
/// <param name="pdfFileName"></param>
/// <returns></returns>
public int SaveToPDF(string directory, string pdfFileName)
{
try
{
//FB 29493 Error message in log before success message
if (MainShell.DesiredSize.Height == 0 || MainShell.DesiredSize.Width == 0) return 0;
if (string.IsNullOrEmpty(directory) || string.IsNullOrEmpty(pdfFileName) || !pdfFileName.EndsWith(".pdf")) return -1;
var bounds = VisualTreeHelper.GetDescendantBounds(MainShell);
// desired resolution:
double dpiX = 300, dpiY = 300;
var bmp = new RenderTargetBitmap((int)(bounds.Width * dpiX / 96.0), (int)(bounds.Height * dpiY / 96.0), dpiX, dpiY, PixelFormats.Pbgra32);
bmp.Render(MainShell);
var wBmp = new WriteableBitmap(bmp);
var pdf = new C1PdfDocument
{
Landscape = true,
PageSize = new Size(MainShell.ActualWidth, MainShell.ActualHeight)
};
pdf.DrawImage(wBmp, new Rect(0, 0, MainShell.ActualWidth, MainShell.ActualHeight));
pdf.Save(Path.Combine(directory, pdfFileName));
DTS.Common.Utils.PNGImageUtil.SaveImage(MainShell, System.IO.Path.Combine(directory, pdfFileName.Replace(".pdf", ".png")));
return 1;
}
catch (Exception ex)
{
APILogger.LogException(ex);
}
return -1;
}
}
}

View File

@@ -0,0 +1,407 @@
<base:BaseView x:Class="DTS.Viewer.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
xmlns:interactionRequest="clr-namespace:Microsoft.Practices.Prism.Interactivity.InteractionRequest;assembly=Microsoft.Practices.Prism.Interactivity"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="Auto" Width="Auto">
<base:BaseView.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<ResourceDictionary x:Key="ResourceDictionary">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../../Themes/Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
<!--<Style x:Key="{x:Type dock:DockingManager}" x:Name="DockingManagerStyle" TargetType="{x:Type dock:DockingManager}">
<Setter Property="Background" Value="{DynamicResource {x:Static dock:AeroColors.BaseColor1Key}}"/>
<Setter Property="DocumentPaneControlStyle" Value="{StaticResource AvalonDock_ThemeAero_DocumentPaneControlStyle}"/>
<Setter Property="AnchorablePaneControlStyle" Value="{StaticResource AvalonDock_ThemeAero_AnchorablePaneControlStyle}"/>
<Setter Property="AnchorSideTemplate" Value="{StaticResource AvalonDock_ThemeAero_AnchorSideTemplate}"/>
<Setter Property="AnchorGroupTemplate" Value="{StaticResource AvalonDock_ThemeAero_AnchorGroupTemplate}"/>
<Setter Property="AnchorTemplate" Value="{StaticResource AvalonDock_ThemeAero_AnchorTemplate}"/>
<Setter Property="DocumentHeaderTemplate" Value="{StaticResource AvalonDock_ThemeAero_DocumentHeaderTemplate}"/>
<Setter Property="AnchorableHeaderTemplate" Value="{StaticResource AvalonDock_ThemeAero_AnchorableHeaderTemplate}"/>
<Setter Property="DocumentTitleTemplate" Value="{StaticResource AvalonDock_ThemeAero_DocumentTitleTemplate}"/>
<Setter Property="AnchorableTitleTemplate" Value="{StaticResource AvalonDock_ThemeAero_AnchorableTitleTemplate}"/>
<Setter Property="AnchorableContextMenu" Value="{StaticResource AvalonDock_ThemeAero_AnchorableContextMenu}"/>
<Setter Property="DocumentContextMenu" Value="{StaticResource AvalonDock_ThemeAero_DocumentContextMenu}"/>
<Setter Property="DocumentPaneMenuItemHeaderTemplate" Value="{StaticResource AvalonDock_ThemeAero_DocumentHeaderTemplate}"/>
<Setter Property="IconContentTemplate" Value="{StaticResource AvalonDock_ThemeAero_IconContentTemplate}"/>
<Setter Property="GridSplitterWidth" Value="4"/>
<Setter Property="GridSplitterHeight" Value="4"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="VerticalAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dock:DockingManager}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Grid Grid.IsSharedSizeScope="True">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<ContentPresenter Content="{TemplateBinding LayoutRootPanel}" Grid.Column="1" Grid.Row="1"/>
<ContentPresenter Content="{TemplateBinding RightSidePanel}" Grid.Column="2" Grid.Row="1"/>
<ContentPresenter Content="{TemplateBinding LeftSidePanel}" Grid.Column="0" Grid.Row="1"/>
<ContentPresenter Content="{TemplateBinding TopSidePanel}" Grid.Column="1" Grid.Row="0"/>
<ContentPresenter Content="{TemplateBinding BottomSidePanel}" Grid.Column="1" Grid.Row="2"/>
<ContentPresenter x:Name="PART_AutoHideArea" Content="{TemplateBinding AutoHideWindow}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="1"/>
</Grid>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>-->
</base:BaseView.Resources>
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<StackPanel x:Name="MainShell" Orientation="Vertical" VerticalAlignment="Stretch" >
<dock:DockingManager BorderBrush="Black" BorderThickness="1" AllowMixedOrientation="True" Style="{DynamicResource {x:Type dock:DockingManager}}"
ShowSystemMenu="False" UseLayoutRounding="False" IsManipulationEnabled="True"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<dock:DockingManager.Resources>
<Style TargetType="{x:Type dock:LayoutDocumentTabItem}">
<Setter Property="Width" Value="80" />
</Style>
</dock:DockingManager.Resources>
<dock:DockingManager.Theme>
<dock:AeroTheme/>
</dock:DockingManager.Theme>
<dock:DockingManager.AnchorablePaneControlStyle>
<Style TargetType="{x:Type dock:LayoutAnchorablePaneControl}" >
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="TabStripPlacement" Value="Top"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="{Binding Model.Root.Manager.Foreground, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Background" Value="{Binding Model.Root.Manager.Background, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dock:LayoutAnchorablePaneControl}">
<Grid x:Name="grid" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Background="Transparent" Grid.RowSpan="2"/>
<Border x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Cycle"/>
<dock:AnchorablePaneTabPanel Grid.Row="0" x:Name="HeaderPanel" Margin="0,0,2,2" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
<Grid Grid.Row="1">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource Self}}" Value="1">
<Setter Property="Margin" Value="0" TargetName="HeaderPanel"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="{x:Type TabItem}" >
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor4, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor5, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor12, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="ToolTip" Value="{Binding ToolTip}"/>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid SnapsToDevicePixels="True">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentSource="Header" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor2, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor3, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="1"/>
<Setter Property="Margin" Value="0,0,0,0"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor32, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor27, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="0"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor13, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor9, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="1">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableTabItem Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableControl Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</dock:DockingManager.AnchorablePaneControlStyle>
<dock:DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Source="{Binding IconSource}" Margin="0,0,4,0"/>
<TextBlock Text="{Binding Title}" />
</StackPanel>
</DataTemplate>
</dock:DockingManager.DocumentHeaderTemplate>
<dock:LayoutRoot x:Name="_layoutRoot">
<dock:LayoutRoot.LeftSide >
<dock:LayoutAnchorSide>
<dock:LayoutAnchorGroup>
<dock:LayoutAnchorable CanHide="False" CanClose="False" AutoHideWidth="250" Title ="0987654321" IsMaximized="True">
<ContentControl x:Name="NavigationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Let"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable CanHide="False" CanClose="False" AutoHideWidth="250" Title ="1234567890">
<ContentControl x:Name="NavigationRegion1" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Let"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorGroup>
</dock:LayoutAnchorSide>
</dock:LayoutRoot.LeftSide>
<dock:LayoutPanel Orientation="Horizontal" >
<dock:LayoutDocumentPaneGroup IsMaximized="True">
<dock:LayoutDocumentPane x:Name="ViewerPane" IsMaximized="True" >
<dock:LayoutDocument ContentId="viewerEu" Title="EU " CanClose="False" >
<ContentControl x:Name="EuRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerEuRegion}" MinWidth="500" MinHeight="500" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="EU"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutDocument>
<dock:LayoutDocument ContentId="viewerMv" Title="mV " CanClose="False" >
<ContentControl x:Name="MvRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerMvRegion}" MinWidth="500" MinHeight="500" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="mV"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutDocument>
<dock:LayoutDocument ContentId="viewerEdc" Title="EDC " CanClose="False" >
<ContentControl x:Name="EdcRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerEdcRegion}" MinWidth="500" MinHeight="500" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="EDC"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutDocument>
</dock:LayoutDocumentPane>
</dock:LayoutDocumentPaneGroup>
</dock:LayoutPanel>
<dock:LayoutRoot.RightSide>
<dock:LayoutAnchorSide>
<dock:LayoutAnchorGroup>
<dock:LayoutAnchorable Title="Diag" CanHide="False" CanClose="False" AutoHideWidth="250" >
<ContentControl x:Name="DiagRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerDiagRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Stats" CanHide="False" CanClose="False" AutoHideWidth="250" >
<ContentControl x:Name="StatsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerStatsRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Cursor" CanHide="False" CanClose="False" AutoHideWidth="250" >
<ContentControl x:Name="CursorRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerCursorRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorGroup>
<dock:LayoutAnchorGroup>
<dock:LayoutAnchorable Title="Display" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True" >
<ContentControl x:Name="PropertyRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyDisplayRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Modify" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="ModifyRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyModifyRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Add" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True" >
<ContentControl x:Name="AddRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyAddRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorGroup>
</dock:LayoutAnchorSide>
</dock:LayoutRoot.RightSide>
<dock:LayoutRoot.BottomSide>
<dock:LayoutAnchorSide>
<dock:LayoutAnchorGroup>
<dock:LayoutAnchorable Title="Tests" CanHide="False" CanClose="False" >
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestsRegion}" MinHeight="200"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Graphs" CanHide="False" CanClose="False" >
<ContentControl x:Name="GraphsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphsRegion}" MinHeight="200"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Legend" CanHide="False" CanClose="False" >
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}" MinHeight="250"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorGroup>
</dock:LayoutAnchorSide>
</dock:LayoutRoot.BottomSide>
</dock:LayoutRoot>
</dock:DockingManager>
</StackPanel>
</base:BaseView>

View File

@@ -0,0 +1,359 @@
<base:BaseView x:Class="DTS.Viewer.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
xmlns:interactionRequest="clr-namespace:Microsoft.Practices.Prism.Interactivity.InteractionRequest;assembly=Microsoft.Practices.Prism.Interactivity"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="Auto" Height="Auto" >
<base:BaseView.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<ResourceDictionary x:Key="ResourceDictionary">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../../Themes/Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</base:BaseView.Resources>
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<Grid x:Name="MainShell" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<dock:DockingManager Grid.Row="0" BorderBrush="Black" BorderThickness="1" AllowMixedOrientation="True"
Style="{DynamicResource {x:Type dock:DockingManager}}"
ShowSystemMenu="False" UseLayoutRounding="False" IsManipulationEnabled="True"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" >
<dock:DockingManager.Resources>
<Style TargetType="{x:Type dock:LayoutDocumentTabItem}">
<Setter Property="Width" Value="80" />
</Style>
</dock:DockingManager.Resources>
<dock:DockingManager.Theme>
<dock:AeroTheme/>
</dock:DockingManager.Theme>
<dock:DockingManager.AnchorablePaneControlStyle>
<Style TargetType="{x:Type dock:LayoutAnchorablePaneControl}" >
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="TabStripPlacement" Value="Top"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="{Binding Model.Root.Manager.Foreground, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Background" Value="{Binding Model.Root.Manager.Background, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dock:LayoutAnchorablePaneControl}">
<Grid x:Name="grid" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Background="Transparent" Grid.RowSpan="2"/>
<Border x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Cycle"/>
<dock:AnchorablePaneTabPanel Grid.Row="0" x:Name="HeaderPanel" Margin="0,0,2,2" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
<Grid Grid.Row="1">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource Self}}" Value="1">
<Setter Property="Margin" Value="0" TargetName="HeaderPanel"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="{x:Type TabItem}" >
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor4, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor5, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor12, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="ToolTip" Value="{Binding ToolTip}"/>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid SnapsToDevicePixels="True">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentSource="Header" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor2, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor3, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="1"/>
<Setter Property="Margin" Value="0,0,0,0"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor32, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor27, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="0"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor13, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor9, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="1">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableTabItem Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableControl Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</dock:DockingManager.AnchorablePaneControlStyle>
<dock:DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Source="{Binding IconSource}" Margin="0,0,4,0"/>
<TextBlock Text="{Binding Title}" />
</StackPanel>
</DataTemplate>
</dock:DockingManager.DocumentHeaderTemplate>
<dock:LayoutRoot x:Name="_layoutRoot">
<dock:LayoutPanel Orientation="Horizontal" IsMaximized="True" DockHeight="Auto" >
<dock:LayoutAnchorablePane DockWidth="250" DockHeight="*">
<dock:LayoutAnchorable CanHide="False" CanClose="False" AutoHideWidth="250" Title ="0987654321" IsMaximized="True">
<ContentControl x:Name="NavigationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Let"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable CanHide="False" CanClose="False" AutoHideWidth="250" Title ="1234567890">
<ContentControl x:Name="NavigationRegion1" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Let"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutPanel Orientation="Vertical" IsMaximized="True" DockHeight="*">
<dock:LayoutDocumentPaneGroup Orientation="Horizontal">
<dock:LayoutDocumentPane x:Name="ViewerPane" IsMaximized="True" DockMinHeight="500" DockMinWidth="500" DockHeight="500*">
<dock:LayoutDocument ContentId="viewerEu" Title="EU" CanClose="False" IsMaximized="True">
<ContentControl x:Name="EuRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerEuRegion}"
MinHeight="500" MinWidth="500"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="EU"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutDocument>
<dock:LayoutDocument ContentId="viewerMv" Title="mV" CanClose="False" IsMaximized="True" >
<ContentControl x:Name="MvRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerMvRegion}"
MinHeight="500" MinWidth="500"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="mV"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutDocument>
<dock:LayoutDocument ContentId="viewerEdc" Title="ADC" CanClose="False" IsMaximized="True" >
<ContentControl x:Name="EdcRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerEdcRegion}"
MinHeight="500" MinWidth="500"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="EDC"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutDocument>
</dock:LayoutDocumentPane>
</dock:LayoutDocumentPaneGroup>
<dock:LayoutAnchorablePane DockHeight="250" IsMaximized="True" >
<dock:LayoutAnchorable Title="Tests" CanHide="False" CanClose="False" IsMaximized="True">
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestsRegion}"
Height="200" MinHeight="200"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Graphs" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="GraphsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphsRegion}"
Height="200" MinHeight="200"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Legend" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}"
Height="200" MinHeight="200"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
<dock:LayoutPanel Orientation="Vertical" DockWidth="250" DockHeight="*" IsMaximized="True">
<dock:LayoutAnchorablePane >
<dock:LayoutAnchorable Title="Diag" CanHide="False" CanClose="False" AutoHideWidth="250" >
<ContentControl x:Name="DiagRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerDiagRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Stats" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="StatsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerStatsRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Cursor" CanHide="False" CanClose="False" IsMaximized="True" >
<ContentControl x:Name="CursorRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerCursorRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutAnchorablePane DockWidth="250" DockHeight="*" >
<dock:LayoutAnchorable Title="Display" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True" >
<ContentControl x:Name="PropertyRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyDisplayRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Modify" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="ModifyRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyModifyRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Add" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True" >
<ContentControl x:Name="AddRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyAddRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
</dock:LayoutPanel>
</dock:LayoutRoot>
</dock:DockingManager>
</Grid>
</base:BaseView>

View File

@@ -0,0 +1,208 @@
<base:BaseView x:Class="DTS.Viewer.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
xmlns:interactionRequest="clr-namespace:Microsoft.Practices.Prism.Interactivity.InteractionRequest;assembly=Microsoft.Practices.Prism.Interactivity"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<!--<base:BaseView.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<ResourceDictionary x:Key="ResourceDictionary">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../../Themes/Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</base:BaseView.Resources>-->
<StackPanel x:Name="MainShell" Orientation="Vertical" VerticalAlignment="Stretch" >
<dock:DockingManager VerticalAlignment="Stretch" HorizontalAlignment="Stretch" BorderBrush="Black" BorderThickness="1" ShowSystemMenu="False">
<dock:DockingManager.Theme>
<dock:VS2010Theme/>
</dock:DockingManager.Theme>
<dock:DockingManager.Resources>
<Style TargetType="{x:Type dock:LayoutDocumentTabItem}">
<Setter Property="Width" Value="80" />
</Style>
<Style TargetType="{x:Type dock:LayoutAnchorableTabItem}">
<Setter Property="Width" Value="50" />
<Setter Property="VerticalAlignment" Value="Top"/>
</Style>
</dock:DockingManager.Resources>
<!--<dock:DockingManager.Theme>
<dock:AeroTheme/>
</dock:DockingManager.Theme>-->
<dock:DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Source="{Binding IconSource}" Margin="0,0,4,0"/>
<TextBlock Text="{Binding Title}" />
</StackPanel>
</DataTemplate>
</dock:DockingManager.DocumentHeaderTemplate>
<dock:LayoutRoot x:Name="_layoutRoot" >
<dock:LayoutPanel Orientation="Horizontal">
<!-- NavigationRegion -->
<dock:LayoutAnchorablePane DockWidth="250" >
<dock:LayoutAnchorable CanHide="False" CanClose="False" AutoHideWidth="250">
<ContentControl x:Name="NavigationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Label>Let</Label>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutPanel Orientation="Vertical" IsMaximized="True">
<dock:LayoutDocumentPaneGroup>
<dock:LayoutDocumentPane x:Name="ViewerPane" >
<dock:LayoutDocument ContentId="viewerEu" Title="EU " CanClose="False" >
<ContentControl x:Name="EuRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerEuRegion}" MinWidth="500" MinHeight="500" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Label>EU</Label>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutDocument>
<dock:LayoutDocument ContentId="viewerMv" Title="mV " CanClose="False" >
<ContentControl x:Name="MvRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerMvRegion}" MinWidth="500" MinHeight="500" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Label>mV</Label>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutDocument>
<dock:LayoutDocument ContentId="viewerEdc" Title="EDC " CanClose="False" >
<ContentControl x:Name="EdcRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerEdcRegion}" MinWidth="500" MinHeight="500" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Label>EDC</Label>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutDocument>
</dock:LayoutDocumentPane>
</dock:LayoutDocumentPaneGroup >
<dock:LayoutAnchorablePaneGroup Orientation="Horizontal" DockHeight="270">
<dock:LayoutAnchorablePane >
<dock:LayoutAnchorable Title="Tests" CanHide="False" CanClose="False" AutoHideHeight="250">
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestsRegion}" MinHeight="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Graphs" CanHide="False" CanClose="False" AutoHideHeight="250">
<ContentControl x:Name="GraphsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphsRegion}" MinHeight="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Legend" CanHide="False" CanClose="False" AutoHideHeight="250">
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}" MinHeight="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutAnchorablePaneGroup>
</dock:LayoutPanel>
<dock:LayoutPanel Orientation="Vertical">
<dock:LayoutAnchorablePaneGroup >
<dock:LayoutAnchorablePane>
<dock:LayoutAnchorable Title="Diag" CanHide="False" CanClose="False" AutoHideWidth="250">
<ContentControl x:Name="DiagRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerDiagRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Stats" CanHide="False" CanClose="False" AutoHideWidth="250">
<ContentControl x:Name="StatsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerStatsRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Cursor" CanHide="False" CanClose="False" AutoHideWidth="250">
<ContentControl x:Name="CursorRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerCursorRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutAnchorablePaneGroup>
<dock:LayoutAnchorablePaneGroup >
<dock:LayoutAnchorablePane>
<dock:LayoutAnchorable Title="Properies" CanHide="False" CanClose="False" AutoHideWidth="250">
<ContentControl x:Name="PropertyRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutAnchorablePaneGroup>
</dock:LayoutPanel>
</dock:LayoutPanel>
</dock:LayoutRoot>
</dock:DockingManager>
</StackPanel>
</base:BaseView>

View File

@@ -0,0 +1,320 @@
<base:BaseView x:Class="DTS.Viewer.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
xmlns:interactionRequest="clr-namespace:Microsoft.Practices.Prism.Interactivity.InteractionRequest;assembly=Microsoft.Practices.Prism.Interactivity"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="Auto" Height="Auto" >
<base:BaseView.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<ResourceDictionary x:Key="ResourceDictionary">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../../Themes/Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</base:BaseView.Resources>
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<toolkit:BusyIndicator IsBusy="{Binding IsBusy}" BusyContent="{Binding IsBusyMessage}" >
<Grid x:Name="MainShell" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<dock:DockingManager Grid.Row="0" BorderBrush="Black" BorderThickness="1" AllowMixedOrientation="True"
Style="{DynamicResource {x:Type dock:DockingManager}}"
ShowSystemMenu="False" UseLayoutRounding="False" IsManipulationEnabled="True"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" >
<dock:DockingManager.Resources>
<Style TargetType="{x:Type dock:LayoutDocumentTabItem}">
<Setter Property="Width" Value="80" />
</Style>
</dock:DockingManager.Resources>
<dock:DockingManager.Theme>
<dock:AeroTheme/>
</dock:DockingManager.Theme>
<dock:DockingManager.AnchorablePaneControlStyle>
<Style TargetType="{x:Type dock:LayoutAnchorablePaneControl}" >
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="TabStripPlacement" Value="Top"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="{Binding Model.Root.Manager.Foreground, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Background" Value="{Binding Model.Root.Manager.Background, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dock:LayoutAnchorablePaneControl}">
<Grid x:Name="grid" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Background="Transparent" Grid.RowSpan="2"/>
<Border x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Cycle"/>
<dock:AnchorablePaneTabPanel Grid.Row="0" x:Name="HeaderPanel" Margin="0,0,2,2" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
<Grid Grid.Row="1">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource Self}}" Value="1">
<Setter Property="Margin" Value="0" TargetName="HeaderPanel"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="{x:Type TabItem}" >
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor4, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor5, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor12, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="ToolTip" Value="{Binding ToolTip}"/>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid SnapsToDevicePixels="True">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentSource="Header" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor2, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor3, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="1"/>
<Setter Property="Margin" Value="0,0,0,0"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor32, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor27, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="0"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor13, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor9, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="1">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableTabItem Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableControl Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</dock:DockingManager.AnchorablePaneControlStyle>
<dock:DockingManager.DocumentHeaderTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Image Source="{Binding IconSource}" Margin="0,0,4,0"/>
<TextBlock Text="{Binding Title}" />
</StackPanel>
</DataTemplate>
</dock:DockingManager.DocumentHeaderTemplate>
<dock:LayoutRoot x:Name="_layoutRoot">
<dock:LayoutPanel Orientation="Horizontal" IsMaximized="True" DockHeight="Auto" >
<dock:LayoutAnchorablePane DockWidth="250" DockHeight="*">
<dock:LayoutAnchorable CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="NavigationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template >
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Let"/>
<ContentPresenter Content="{TemplateBinding Content}" MinWidth="200" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutPanel Orientation="Vertical" IsMaximized="True" DockHeight="*">
<dock:LayoutAnchorablePane>
<dock:LayoutAnchorable IsActive="True" CanAutoHide="False" CanClose="False" CanHide="False">
<ContentControl x:Name="GraphRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphRegion}"
MinHeight="500" MinWidth="500"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Graph"/>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutAnchorablePane DockHeight="250" IsMaximized="True" >
<dock:LayoutAnchorable Title="Tests" CanHide="False" CanClose="False" IsMaximized="True">
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestsRegion}"
Height="200" MinHeight="200"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Graphs" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="GraphsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphsRegion}"
Height="200" MinHeight="200"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Legend" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}"
Height="200" MinHeight="200"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
<dock:LayoutPanel Orientation="Vertical" DockWidth="250" DockHeight="*" IsMaximized="True">
<dock:LayoutAnchorablePane >
<dock:LayoutAnchorable Title="Diag" CanHide="False" CanClose="False" AutoHideWidth="250" >
<ContentControl x:Name="DiagRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerDiagRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Stats" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="StatsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerStatsRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Cursor" CanHide="False" CanClose="False" IsMaximized="True" >
<ContentControl x:Name="CursorRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerCursorRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutAnchorablePane DockWidth="250" DockHeight="*" >
<dock:LayoutAnchorable Title="Display" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True" >
<ContentControl x:Name="PropertyRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyDisplayRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Modify" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True">
<ContentControl x:Name="ModifyRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyModifyRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable Title="Add" CanHide="False" CanClose="False" AutoHideWidth="250" IsMaximized="True" >
<ContentControl x:Name="AddRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyAddRegion}" MinWidth="250" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
</dock:LayoutPanel>
</dock:LayoutRoot>
</dock:DockingManager>
</Grid>
</toolkit:BusyIndicator>
</base:BaseView>

View File

@@ -0,0 +1,15 @@
using DTS.Common.Interface;
namespace DTS.Viewer
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainView : IMainView
{
public MainView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,92 @@
<base:BaseView x:Class="DTS.Viewer.MainViewLite"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
xmlns:interactionRequest="clr-namespace:Microsoft.Practices.Prism.Interactivity.InteractionRequest;assembly=Microsoft.Practices.Prism.Interactivity"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common">
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<base:BaseView.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<ResourceDictionary x:Key="ResourceDictionary">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../../Themes/Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</base:BaseView.Resources>
<!--<ContentControl x:Name="MenuRegion" MinHeight="50" Visibility="{Binding IsMenuIncluded, Converter={StaticResource BooleanToVisibilityConverter}}" >
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>-->
<StackPanel x:Name="MainShell" Orientation="Vertical" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<StackPanel Orientation="Horizontal" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl x:Name="NavigationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinHeight="500" MinWidth="150"
Visibility="{Binding IsNavigationIncluded, Converter={StaticResource BooleanToVisibilityConverter}}" >
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Label>Let</Label>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
<ContentControl x:Name="MainRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.MainRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
MinHeight="500" MinWidth="1000">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Label>Center</Label>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
<ContentControl x:Name="VerticalTabRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.VerticalTabRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinHeight="250" MinWidth="250"
Visibility="{Binding IsNavigationIncluded, Converter={StaticResource BooleanToVisibilityConverter}}" >
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Label>Right</Label>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</StackPanel>
<ContentControl x:Name="HorizontalTabRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.HorizontalTabRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinHeight="250" MinWidth="250"
Visibility="{Binding IsNavigationIncluded, Converter={StaticResource BooleanToVisibilityConverter}}" >
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Label>Bottom</Label>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</StackPanel>
</base:BaseView>

View File

@@ -0,0 +1,16 @@
using System.Windows.Controls;
using DTS.Common.Interface;
namespace DTS.Viewer
{
/// <summary>
/// Interaction logic for MainViewLite.xaml
/// </summary>
public partial class MainViewLite : IMainViewerView
{
public MainViewLite()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,332 @@
<base:BaseView x:Class="DTS.Viewer.ViewerMainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:prism="http://prismlibrary.com/"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock"
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:interactivity="clr-namespace:DTS.Common.Interactivity;assembly=DTS.Common"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<base:BaseView.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<converters:WidthConverter x:Key="WidthConverter" />
</base:BaseView.Resources>
<i:Interaction.Triggers>
<interactivity:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactivity:InteractionRequestTrigger>
</i:Interaction.Triggers>
<toolkit:BusyIndicator IsBusy="{Binding IsBusy, UpdateSourceTrigger=PropertyChanged}" BusyContent="{Binding IsBusyMessage}" Visibility="Visible" >
<DockPanel x:Name="MainShell" FlowDirection="LeftToRight" LastChildFill="True" SnapsToDevicePixels="True" WindowChrome.ResizeGripDirection="TopLeft" >
<dock:DockingManager Name="DockManager" BorderBrush="Black" BorderThickness="1" AllowMixedOrientation="True" Style="{DynamicResource {x:Type dock:DockingManager}}"
ShowSystemMenu="False" UseLayoutRounding="False" IsManipulationEnabled="True"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" >
<dock:DockingManager.Resources>
<Style TargetType="{x:Type dock:LayoutDocumentTabItem}">
<Setter Property="Width" Value="100" />
</Style>
</dock:DockingManager.Resources>
<dock:DockingManager.Theme>
<dock:AeroTheme/>
</dock:DockingManager.Theme>
<dock:DockingManager.AnchorablePaneControlStyle>
<Style TargetType="{x:Type dock:LayoutAnchorablePaneControl}" >
<Setter Property="OverridesDefaultStyle" Value="True"/>
<Setter Property="TabStripPlacement" Value="Top"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Foreground" Value="{Binding Model.Root.Manager.Foreground, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Background" Value="{Binding Model.Root.Manager.Background, RelativeSource={RelativeSource Self}}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type dock:LayoutAnchorablePaneControl}">
<Grid x:Name="grid" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Border Background="Transparent" Grid.RowSpan="2"/>
<Border Grid.Row="0" x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" KeyboardNavigation.DirectionalNavigation="Contained" KeyboardNavigation.TabIndex="2" KeyboardNavigation.TabNavigation="Cycle"/>
<dock:AnchorablePaneTabPanel Grid.Row="0" x:Name="HeaderPanel" Margin="0,0,2,2" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1"/>
<Grid Grid.Row="1">
<ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Grid>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource Self}}" Value="1">
<Setter Property="Margin" Value="0" TargetName="HeaderPanel"/>
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="{x:Type TabItem}" >
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor4, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor5, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor12, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="IsSelected" Value="{Binding IsSelected, Mode=TwoWay}"/>
<Setter Property="ToolTip" Value="{Binding ToolTip}"/>
<Setter Property="Margin" Value="0,0,0,0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Grid SnapsToDevicePixels="True">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentSource="Header" HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"/>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor2, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor3, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="1"/>
<Setter Property="Margin" Value="0,0,0,0"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True"/>
<Condition Property="IsSelected" Value="False"/>
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor32, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor27, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Panel.ZIndex" Value="0"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="BorderBrush" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor13, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Background" Value="{DynamicResource {ComponentResourceKey ResourceId=BaseColor9, TypeInTargetAssembly={x:Type dock:AeroColors}}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="1">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Setter.Value>
</Setter>
<Setter Property="ItemTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableTabItem Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<dock:LayoutAnchorableControl Model="{Binding}"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
</dock:DockingManager.AnchorablePaneControlStyle>
<dock:LayoutRoot x:Name="_layoutRoot" >
<dock:LayoutPanel Orientation="Horizontal" IsMaximized="True" DockHeight="*" >
<dock:LayoutAnchorablePane Name="NavigationPane" DockWidth="250" DockHeight="*">
<dock:LayoutAnchorable ContentId="NavigationRegionPanel" IsMaximized="True" AutoHideWidth="100" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="NavigationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.NavigationRegion}"
Width="250" VerticalAlignment="Stretch" HorizontalAlignment="Left">
<ContentControl.Template >
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<Label Content="Left"/>
<ContentPresenter Content="{TemplateBinding Content}" MinWidth="240" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutPanel Orientation="Vertical" IsMaximized="True" DockHeight="*" DockWidth="Auto">
<dock:LayoutAnchorablePane Name="GraphPane" DockWidth="*" DockHeight="*">
<dock:LayoutAnchorable CanAutoHide="False" CanClose="False" CanHide="False">
<ContentControl x:Name="GraphRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphsRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
Height="Auto" Width="Auto" MinHeight="500" MinWidth="500">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutAnchorablePane Name="TestPane" DockMinHeight="100" DockWidth="*" DockHeight="*" >
<dock:LayoutAnchorable ContentId="TestRegionPanel" x:Name="TestRegionPanel" Title="Tests" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True" >
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="ViewerTestsRegion2"
Width="{Binding Path=ActualWidth, ElementName=TestPane, Converter={StaticResource WidthConverter}, ConverterParameter='1'}"
Height="{Binding Path=ActualHeight, ElementName=TestPane, Converter={StaticResource WidthConverter}, ConverterParameter='1'}"
VerticalAlignment="Top" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="GraphRegionPanel" x:Name="GraphListPanel" Title="Graphs" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True">
<ContentControl x:Name="GraphListRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphListRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="SettingsRegionPanel" x:Name="SettingsPanel" Title="Settings" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True">
<ContentControl x:Name="SettingsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerSettingsRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="LegendRegionPanel" Title="Legend" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="True">
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
<dock:LayoutPanel Orientation="Vertical" DockWidth="320" DockMinWidth="300" DockHeight="Auto" >
<dock:LayoutAnchorablePane Name="DiagnosticPane" DockWidth="300" DockMinWidth="300" DockHeight="*" IsMaximized="True" >
<dock:LayoutAnchorable ContentId="DiagRegionPanel" Title="Diag" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="DiagRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerDiagRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="StatsRegionPanel" Title="Stats" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="StatsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerStatsRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="CursorRegionPanel" Title="Cursor" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="CursorRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerCursorRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
<dock:LayoutAnchorablePane Name="ModificationPane" DockWidth="300" DockMinWidth="300" DockHeight="*" IsMaximized="True" >
<dock:LayoutAnchorable ContentId="ChartOptionsPanel" Title="Display" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="ChartOptionsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerChartOptionsRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="ModifyRegionPanel" Title="Modify" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="TestModificationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestModificationRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
<dock:LayoutAnchorable ContentId="AddRegionPanel" Title="Add" CanClose="False" CanHide="False" CanAutoHide="True" CanFloat="False" >
<ContentControl x:Name="AddRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyAddRegion}"
Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</dock:LayoutAnchorable>
</dock:LayoutAnchorablePane>
</dock:LayoutPanel>
</dock:LayoutPanel>
</dock:LayoutRoot>
</dock:DockingManager>
<!--</Grid>-->
</DockPanel>
</toolkit:BusyIndicator>
</base:BaseView>

View File

@@ -0,0 +1,47 @@
using DTS.Common.Interface;
// ReSharper disable CheckNamespace
// ReSharper disable ArrangeTypeMemberModifiers
// ReSharper disable UnusedMember.Local
// ReSharper disable UnusedParameter.Local
// ReSharper disable RedundantDefaultMemberInitializer
// ReSharper disable ConvertClosureToMethodGroup
// ReSharper disable PossibleNullReferenceException
namespace DTS.Viewer
{
/// <summary>
/// Interaction logic for ViewerMainView.xaml
/// </summary>
public partial class ViewerMainView : IViewerMainView
{
public ViewerMainView()
{
InitializeComponent();
//this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
//this.Unloaded += new RoutedEventHandler(MainWindow_Unloaded);
}
//void MainWindow_Loaded(object sender, RoutedEventArgs e)
//{
// var serializer = new XmlLayoutSerializer(DockManager);
// serializer.LayoutSerializationCallback += (s, args) =>
// {
// args.Content = args.Content;
// };
// if (File.Exists(@".\DataProViewerAvalonDock.config"))
// serializer.Deserialize(@".\DataProViewerAvalonDock.config");
//}
//void MainWindow_Unloaded(object sender, RoutedEventArgs e)
//{
// var serializer = new XmlLayoutSerializer(DockManager);
// serializer.Serialize(@".\DataProViewerAvalonDock.config");
//}
}
}

View File

@@ -0,0 +1,211 @@
<base:BaseView x:Class="DTS.Viewer.ViewerMainViewGrid"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
xmlns:prism="http://prismlibrary.com/"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
xmlns:strings="clr-namespace:DTS.Viewer"
xmlns:interactionRequest="clr-namespace:DTS.Common.Interactivity;assembly=DTS.Common"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<Grid x:Name="MainShell" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" UseLayoutRounding="True" SnapsToDevicePixels="True" >
<Grid.ColumnDefinitions>
<ColumnDefinition x:Name="testsColumn" Width="310" />
<ColumnDefinition x:Name="separatorColumn" Width="5" />
<ColumnDefinition x:Name="graphsColumn" Width="*" />
<ColumnDefinition x:Name="optionsColumn" Width="310" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- FB12164, a repurposed FB11709 -->
<ToggleButton Grid.Column="0" Grid.Row="0" VerticalAlignment="Top" HorizontalAlignment="Right" Panel.ZIndex="140" FontSize="8" AutomationProperties.AutomationId="btnCollapseNavPanel"
Height="15" Width="15" Background="{StaticResource Brush_ApplicationContentBackground}" Content="&lt;&lt;">
<ToggleButton.Triggers>
<EventTrigger RoutedEvent="ToggleButton.Unchecked">
<BeginStoryboard>
<Storyboard x:Name="ShowTabPanel">
<controls:GridLengthAnimation Storyboard.TargetName="testsColumn" Storyboard.TargetProperty="Width" From="15" Duration="0:0:0.1" FillBehavior="Stop" />
<DoubleAnimation Storyboard.TargetName="graphSelectionTabPane" Storyboard.TargetProperty="Opacity" From="0.0" To="1.0" Duration="0:0:0.1" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Content">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="&lt;&lt;" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="ToggleButton.Checked">
<BeginStoryboard>
<Storyboard x:Name="HideTabPanel">
<controls:GridLengthAnimation Storyboard.TargetName="testsColumn" Storyboard.TargetProperty="Width" To="15" Duration="0:0:0.1" />
<DoubleAnimation Storyboard.TargetName="graphSelectionTabPane" Storyboard.TargetProperty="Opacity" From="1.0" To="0.0" Duration="0:0:0.1" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Content">
<DiscreteObjectKeyFrame KeyTime="0:0:0" Value="&gt;&gt;" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</ToggleButton.Triggers>
</ToggleButton>
<TabControl x:Name="graphSelectionTabPane" Grid.Column="0" Grid.Row="0" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AutomationProperties.AutomationId="GraphSelectionTabPane">
<TabItem x:Name="testsTab" Header="{Binding Path=TitleTests}" AutomationProperties.AutomationId="TestsTab">
<ContentControl x:Name="TestsRegion" prism:RegionManager.RegionName="ViewerTestsRegion2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem x:Name="graphsTab" Header="{Binding Path=TitleGraphs}" AutomationProperties.AutomationId="GraphsTab">
<ContentControl x:Name="GraphListRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphListRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem Header="{strings:TranslateExtension SettingsTitle}" Visibility="{Binding SettingsVisibility}" AutomationProperties.AutomationId="SettingsTab">
<ContentControl x:Name="SettingsRegion" prism:RegionManager.RegionName="ViewerSettingsRegion2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem Header="Legend" Visibility="Collapsed" AutomationProperties.AutomationId="LegendTab">
<ContentControl x:Name="LegendRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerLegendRegion}"
Height="Auto" Width="Auto" VerticalAlignment="Top" HorizontalAlignment="Stretch">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
</TabControl>
<GridSplitter Grid.Row="0" Grid.Column="1" VerticalAlignment="Stretch" Width="5" ResizeBehavior="PreviousAndNext" ResizeDirection="Columns"/>
<!-- Graph -->
<ContentControl Grid.Column="2" Grid.Row="0" x:Name="GraphRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerGraphsRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
<TabControl Grid.Column="3" Grid.Row="0" Width="310" HorizontalAlignment="Right" VerticalAlignment="Stretch" AutomationProperties.AutomationId="ModificationTabPane">
<TabItem x:Name="chartOptTab" Header="{strings:TranslateExtension ChartOptionsHeader}" AutomationProperties.AutomationId="ChartOptTab">
<ContentControl x:Name="ChartOptionsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerChartOptionsRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" HorizontalContentAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem x:Name="testModTab" Header="{strings:TranslateExtension ModificationsHeader}" IsSelected="{Binding ShowModifications}" AutomationProperties.AutomationId="TestModTab">
<ContentControl x:Name="TestModificationRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerTestModificationRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
</TabControl>
<TabControl Grid.Column="3" Grid.Row="0" MinWidth="300" Visibility="Collapsed" AutomationProperties.AutomationId="ChartTabPane">
<TabItem>
<ContentControl x:Name="DiagRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerDiagRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem>
<ContentControl x:Name="StatsRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerStatsRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem>
<ContentControl x:Name="CursorRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.ViewerCursorRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right">
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
<TabItem>
<ContentControl x:Name="AddRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.PropertyAddRegion}" Width="300" VerticalAlignment="Stretch" HorizontalAlignment="Right" >
<ContentControl.Template>
<ControlTemplate TargetType="{x:Type ContentControl}">
<Grid>
<ContentPresenter Content="{TemplateBinding Content}" />
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</TabItem>
</TabControl>
</Grid>
</base:BaseView>

View File

@@ -0,0 +1,92 @@
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interface;
using System;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using C1.WPF.Pdf;
using System.Windows;
using System.Windows.Media.Imaging;
using System.Windows.Media;
using DTS.Common.Utilities.Logging;
using Prism.Events;
using Prism.Ioc;
// ReSharper disable CheckNamespace
namespace DTS.Viewer
{
/// <summary>
/// Interaction logic for ViewerMainViewGrid.xaml
/// </summary>
public partial class ViewerMainViewGrid : IViewerMainViewGrid
{
public ViewerMainViewGrid()
{
InitializeComponent();
Loaded += ViewerMainViewGrid_Loaded;
}
private IEventAggregator _eventAggregator { get; set; }
private void SetFocus()
{
chartOptTab.IsSelected = true;
chartOptTab.Focusable = true;
chartOptTab.Focus();
}
//FB 14797 Subscribe to event after the page loaded to make sure eventAggregator is available
private void ViewerMainViewGrid_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
_eventAggregator = ContainerLocator.Container.Resolve<IEventAggregator>();
_eventAggregator?.GetEvent<GraphLoadedCountNotification>().Subscribe(OnGraphLoadedCountNotification);
}
//FB 14797 Set the focus to first tab (chartOptTab) after the graph is fully loaded (3 sec)
private void OnGraphLoadedCountNotification(GraphLoadedCountNotificationArg arg)
{
if (null != DataContext && (IBaseViewModel)DataContext != arg.ParentVM) return;
Task.Run(() =>
{
Thread.Sleep(TimeSpan.FromSeconds(3));
Dispatcher.BeginInvoke((System.Action)SetFocus);
});
}
/// <summary>
/// Returns > 0 if successful, < 0 if failure, or 0 if the MainChart is not ready yet
/// </summary>
/// <param name="directory"></param>
/// <param name="pdfFileName"></param>
/// <returns></returns>
public int SaveToPDF(string directory, string pdfFileName)
{
try
{
//FB 29493 Error message in log before success message
if (MainShell.DesiredSize.Height == 0 || MainShell.DesiredSize.Width == 0) return 0;
if (string.IsNullOrEmpty(directory) || string.IsNullOrEmpty(pdfFileName) || !pdfFileName.EndsWith(".pdf")) return -1;
var bounds = VisualTreeHelper.GetDescendantBounds(MainShell);
// desired resolution:
double dpiX = 300, dpiY = 300;
var bmp = new RenderTargetBitmap((int)(bounds.Width * dpiX / 96.0), (int)(bounds.Height * dpiY / 96.0), dpiX, dpiY, PixelFormats.Pbgra32);
bmp.Render(MainShell);
var wBmp = new WriteableBitmap(bmp);
var pdf = new C1PdfDocument
{
Landscape = true,
PageSize = new Size(MainShell.ActualWidth, MainShell.ActualHeight)
};
pdf.DrawImage(wBmp, new Rect(0, 0, MainShell.ActualWidth, MainShell.ActualHeight));
pdf.Save(Path.Combine(directory, pdfFileName));
DTS.Common.Utils.PNGImageUtil.SaveImage(MainShell, System.IO.Path.Combine(directory, pdfFileName.Replace(".pdf", ".png")));
return 1;
}
catch (Exception ex)
{
APILogger.LogException(ex);
}
return -1;
}
}
}

View File

@@ -0,0 +1,41 @@
<base:BaseWindow x:Class="DTS.Viewer.ViewerShellView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
xmlns:interactionRequest="clr-namespace:Microsoft.Practices.Prism.Interactivity.InteractionRequest;assembly=Microsoft.Practices.Prism.Interactivity"
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
xmlns:converters="clr-namespace:DTS.Common.Converters;assembly=DTS.Common"
xmlns:dialogs="clr-namespace:DTS.Common.Dialogs;assembly=DTS.Common"
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
Background="Silver" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="1400" Height="1000" >
<i:Interaction.Triggers>
<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
<dialogs:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
</interactionRequest:InteractionRequestTrigger>
</i:Interaction.Triggers>
<base:BaseWindow.Resources>
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<ResourceDictionary x:Key="ResourceDictionary">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Themes/Default.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</base:BaseWindow.Resources>
<StackPanel x:Name="MainShell" Orientation="Vertical" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
<ContentControl x:Name="MainRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.MainRegion}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" >
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<ContentPresenter Content="{TemplateBinding Content}" />
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
</StackPanel>
</base:BaseWindow>

View File

@@ -0,0 +1,15 @@
using DTS.Common.Interface;
namespace DTS.Viewer
{
/// <summary>
/// Interaction logic for ShellView.xaml
/// </summary>
public partial class ViewerShellView : IViewerShellView
{
public ViewerShellView()
{
InitializeComponent();
}
}
}

View File

@@ -0,0 +1,526 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Windows;
using System.Windows.Input;
using DTS.Common.Base;
using DTS.Common.Classes.Viewer.Commands;
using DTS.Common.Enums;
using DTS.Common.Enums.Sensors;
using DTS.Common.Events;
using DTS.Common.Interface;
using DTS.Common.Utils;
using DTS.Viewer.Resources;
using Xceed.Wpf.AvalonDock.Layout.Serialization;
using System.Globalization;
using DTS.Common.Interactivity;
using Prism.Regions;
using Prism.Events;
using Unity;
// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable NotAccessedField.Local
// ReSharper disable UnusedMember.Local
// ReSharper disable RedundantDefaultMemberInitializer
namespace DTS.Viewer
{
public class ExportMainViewModel : BaseViewModel<IExportMainViewModel>, IExportMainViewModel
{
public IBaseView View { get; set; }
public bool Standalone { get; set; }
public string SelectedTest { get; set; }
public string SelectedDTSFile { get; set; }
private List<ITestEvent> _selectedEventList = new List<ITestEvent>();
public List<ITestEvent> SelectedEventList
{
get => _selectedEventList;
set { _selectedEventList = value; OnPropertyChanged("SelectedEventList"); }
}
public List<string> AvailableTestIds { get; set; }
private IBaseWindowModel Parent { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the ExportMainViewModel.
/// </summary>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The Unity container.</param>
public ExportMainViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
_unityContainer = unityContainer;
View = _unityContainer.Resolve<IExportMainViewGrid>();
View.DataContext = this;
View.DataContext = this;
}
#region Methods
public void AddSelectedEvents(string groupName, List<ITestEvent> events)
{
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(true);
foreach (var e in events)
{
SelectedEventList.Add(e);
}
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(false);
}
/// <summary>
/// sets SelectedDataFile and marks it as selected in viewer/model
/// 16158 Browse button on View Data tab not functiona
/// </summary>
public void SelectAndIncludeDataFile(string value)
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFile = value;
_eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg
{ Path = string.Empty, File = _selectedDataFile, SetSelected = true, SelectAll = true, ParentVM = this });
OnPropertyChanged("SelectedDataFile");
}
private void OnDataFileSelected(DataFileSelectionArg arg)
{
if (this != arg.ParentVM) return;
SelectAndIncludeDataFile(arg?.File);
}
private void Subscribe()
{
_eventAggregator.GetEvent<LoadExportModuleEvent>().Subscribe(OnLoadExportModule, ThreadOption.PublisherThread, true);
_eventAggregator.GetEvent<TestLoadedCountNotification>().Subscribe(OnTestLoadedChanged);
_eventAggregator.GetEvent<TestSummaryCountNotification>().Subscribe(OnTestSelectedCountChanged);
_eventAggregator.GetEvent<GraphLoadedCountNotification>().Subscribe(OnGraphLoadedCountChanged);
_eventAggregator.GetEvent<ShiftT0Event>().Subscribe(OnShiftT0Event);
_eventAggregator.GetEvent<GraphSelectedEventCountNotification>().Subscribe(OnGraphSelectedCountChanged);
_eventAggregator.GetEvent<GraphChannelsReadCompletedNotification>().Subscribe(OnGraphChannelsReadCompleted, ThreadOption.UIThread);
_eventAggregator.GetEvent<ViewerSettingsVisibilityChangedEvent>().Subscribe(OnViewerSettingsVisibilityChanged);
_eventAggregator.GetEvent<DataFileSelectedEvent>().Subscribe(OnDataFileSelected);
_eventAggregator.GetEvent<SaveToPDFRequestedEvent>().Subscribe(OnSaveToPDFRequested);
}
private void OnViewerSettingsVisibilityChanged(Visibility settingsVisibility)
{
SettingsVisibility = settingsVisibility;
}
private Visibility _settingsVisibility = Visibility.Visible;
public Visibility SettingsVisibility
{
get => _settingsVisibility;
private set
{
_settingsVisibility = value;
OnPropertyChanged("SettingsVisibility");
}
}
/// <summary>
/// Initialize without parameter
/// </summary>
public override void Initialize()
{
Subscribe();
}
/// <summary>
/// Initialize with parameter - Parent
/// </summary>
public override void Initialize(object parameter)
{
Parent = (IBaseWindowModel)parameter;
Parent.IsMenuIncluded = _isMenuIncluded;
Parent.IsNavigationIncluded = _isNavigationIncluded;
Subscribe();
View.DataContext = this;
}
public override void Activated()
{
}
private void OnGraphLoadedCountChanged(GraphLoadedCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalLoadedGraphs = arg.LoadedCount;
}
private void OnGraphSelectedCountChanged(GraphSelectedEventCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalSelectedGraphs = arg.SelectedEventCount;
}
private void OnGraphChannelsReadCompleted(GraphChannelsReadCompletedNotificationArgs arg)
{
if (null == arg) { return; }
if ((IGraphView)ContextGraphRegion == null) { return; }
if (((IGraphView)ContextGraphRegion).DataContext != arg?.GraphVM) return;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(!arg.IsReadCompleted);
}
private void OnTestLoadedChanged(TestLoadedCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalLoadedTests = arg.LoadedCount;
}
private void OnTestSelectedCountChanged(TestSummaryCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalSelectedTests = arg.SummaryCount;
}
private void OnLoadExportModule(LoadExportModuleArg arg)
{
IsBusy = true;
IsBusyMessage = "Loading export list";
if (null == ContextGraphRegion) ContextGraphRegion = GetGraphView(this);
if (null == ContextTestsRegion) ContextTestsRegion = GetTestDefinitionView(this);
if (null == ContextGraphListRegion) ContextGraphListRegion = GetGraphListView(this);
IsBusy = false;
IsBusyMessage = string.Empty;
}
public void ZoomReset()
{
_eventAggregator.GetEvent<ResetZoomChangedEvent>().Publish(true);
}
public void LeftKeyPress()
{
//inform any other modules and models of a T0 shift
_eventAggregator.GetEvent<ShiftT0Event>().Publish(new ShiftT0EventArguments(-1, false, true));
}
public void RightKeyPress()
{
//inform any other modules and models of a T0 shift
_eventAggregator.GetEvent<ShiftT0Event>().Publish(new ShiftT0EventArguments(1, false, true));
}
private void OnShiftT0Event(ShiftT0EventArguments args)
{
if (args.IsInitialization) { return; }
if (args.T0Time != 0) { ShowModifications = true; }
if (args.T0Steps != 0) { ShowModifications = true; }
}
#endregion
#region Views
private IGraphView GetGraphView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IGraphView>();
var viewModel = _unityContainer.Resolve<IGraphViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private IExportGraphMainView GetGraphListView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IExportGraphMainView>();
var viewModel = _unityContainer.Resolve<IExportGraphMainViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private ITestSummaryListView GetTestDefinitionView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<ITestSummaryListView>();
var viewModel = _unityContainer.Resolve<ITestSummaryListViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
#endregion Views
#region ContextRegion
private IBaseViewModel _activeContent;
public IBaseViewModel ActiveContent { get => _activeContent; set { _activeContent = value; OnPropertyChanged("ActiveContent"); } }
public object ContextNavigationRegion
{
get => Standalone ? ((ExportMainView)View).NavigationRegion.Content : ((ExportMainViewGrid)View).NavigationRegion.Content;
set { if (Standalone) ((ExportMainView)View).NavigationRegion.Content = value; else ((ExportMainViewGrid)View).NavigationRegion.Content = value; OnPropertyChanged("ContextNavigationRegion"); }
}
#region Graph
public object ContextGraphRegion
{
get => Standalone ? ((ExportMainView)View).GraphRegion.Content : ((ExportMainViewGrid)View).GraphRegion.Content;
set { if (Standalone) ((ExportMainView)View).GraphRegion.Content = value; else ((ExportMainViewGrid)View).GraphRegion.Content = value; OnPropertyChanged("ContextGraphRegion"); }
}
public object ContextGraphListRegion
{
get => Standalone ? ((ExportMainView)View).GraphListRegion.Content : ((ExportMainViewGrid)View).GraphListRegion.Content;
set { if (Standalone) ((ExportMainView)View).GraphListRegion.Content = value; else ((ExportMainViewGrid)View).GraphListRegion.Content = value; OnPropertyChanged("ContextGraphListRegion"); }
}
#endregion Graph
public object ContextTestsRegion
{
get => Standalone ? ((ExportMainView)View).TestsRegion.Content : ((ExportMainViewGrid)View).TestsRegion.Content;
set { if (Standalone) ((ExportMainView)View).TestsRegion.Content = value; else ((ExportMainViewGrid)View).TestsRegion.Content = value; OnPropertyChanged("ContextTestsRegion"); }
}
public object ContextGraphsRegion
{
get => Standalone ? ((ExportMainView)View).GraphListRegion.Content : ((ExportMainViewGrid)View).GraphListRegion.Content;
set { if (Standalone) ((ExportMainView)View).GraphListRegion.Content = value; else ((ExportMainViewGrid)View).GraphListRegion.Content = value; OnPropertyChanged("ContextGraphsRegion"); }
}
public object ContextPropertyRegion { get; set; }
public List<FrameworkElement> GetRegions()
{
var items = new List<FrameworkElement>();
if (Standalone) Utils.GetChildrenByName(((ExportMainView)View).MainShell, "Region", ref items);
else Utils.GetChildrenByName(((ExportMainViewGrid)View).MainShell, "Region", ref items);
return items;
}
private readonly object saveLock = new object();
private void OnSaveToPDFRequested(string directory)
{
if (null == (ExportMainViewGrid)View) return;
lock (saveLock)
{
var pdfFileName = DateTime.Now.ToString("M'/'d'/'yyyy", CultureInfo.InvariantCulture).Replace("/", "_") + "_" +
DateTime.Now.ToString("h':'mm' 'tt", CultureInfo.InvariantCulture).Replace(":", "_") + "_" + DateTime.Now.Second + "_" +
DateTime.Now.Millisecond + ".pdf";
var intResult = ((ExportMainViewGrid)View).SaveToPDF(directory, pdfFileName);
var output = string.Empty;
if (intResult > 0)
{
//Success
output = string.Format(StringResources.SavePDFSuccess, Environment.NewLine,
Path.Combine(directory, pdfFileName), Environment.NewLine,
Path.Combine(directory, pdfFileName.Replace(".pdf", ".png")));
_eventAggregator.GetEvent<PageErrorEvent>().Publish(new PageErrorArg(new string[] { output }, null));
}
else if (intResult < 0)
{
//Failure
output = StringResources.SavePDFError;
_eventAggregator.GetEvent<PageErrorEvent>().Publish(new PageErrorArg(new string[] { output }, null));
}
}
}
public string ConfigPath { get; set; }
#endregion
#region Properties
#region Test Title
private string _titleTests = StringResources.TestsDefaultTitle;
public string TitleTests
{
get => _titleTests;
set
{
_titleTests = value;
if (Standalone) ((ExportMainView)View).TestRegionPanel.Title = _titleTests;
OnPropertyChanged("TitleTests");
}
}
private int _totalSelectedTests = 0;
public int TotalSelectedTests
{
get => _totalSelectedTests;
set
{
_totalSelectedTests = value;
TitleTests = StringResources.TestsDefaultTitle + TotalSelectedTests + "/" + TotalLoadedTests;
if (_totalSelectedTests == 0) { TitleTestIDs = StringResources.TestIDsDefaultTitle; }
OnPropertyChanged("TotalSelectedTests");
}
}
private int _totalLoadedTests = 0;
public int TotalLoadedTests
{
get => _totalLoadedTests;
set { _totalLoadedTests = value; TitleTests = StringResources.TestsDefaultTitle + TotalSelectedTests + "/" + TotalLoadedTests; OnPropertyChanged("TotalLoadedTests"); }
}
#endregion Test Title
#region Test ID Title
private string _titleTestIDs = StringResources.GraphsDefaultTitle;
public string TitleTestIDs
{
get => _titleTestIDs;
set
{
_titleTestIDs = value;
if (Standalone) ((ExportMainView)View).GraphListPanel.Title = _titleTestIDs;
OnPropertyChanged("TitleTestIDs");
}
}
private int _totalSelectedGraphs = 0;
public int TotalSelectedGraphs
{
get => _totalSelectedGraphs;
set { _totalSelectedGraphs = value; TitleTestIDs = StringResources.GraphsDefaultTitle + TotalSelectedGraphs + "/" + TotalLoadedGraphs; OnPropertyChanged("TotalSelectedGraphs"); }
}
private int _totalLoadedGraphs = 0;
public int TotalLoadedGraphs
{
get => _totalLoadedGraphs;
set { _totalLoadedGraphs = value; TitleTestIDs = StringResources.GraphsDefaultTitle + TotalSelectedGraphs + "/" + TotalLoadedGraphs; OnPropertyChanged("TotalLoadedGraphs"); }
}
#endregion Graph Title
private string _selectedDataFolder = string.Empty;
public string SelectedDataFolder
{
get => _selectedDataFolder;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFolder = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = _selectedDataFolder, File = string.Empty, SelectAll = true, ParentVM = this }); OnPropertyChanged("SelectedDataFolder");
}
}
public bool DoesUserHaveEditPermission { get; set; } = false;
private string _selectedDataFile = string.Empty;
public string SelectedDataFile
{
get => _selectedDataFile;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFile = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = string.Empty, File = _selectedDataFile, SelectAll = true, ParentVM = this }); OnPropertyChanged("SelectedDataFile");
}
}
public bool _showModifications = false;
public bool ShowModifications
{
get => _showModifications;
set { _showModifications = value; OnPropertyChanged("ShowModifications"); }
}
private IsoViewMode _channelCodeViewMode = IsoViewMode.ISOAndUserCode;
public IsoViewMode ChannelCodeViewMode
{
get => _channelCodeViewMode;
set { _channelCodeViewMode = value; _eventAggregator.GetEvent<ChannelCodesViewChangedEvent>().Publish(value); OnPropertyChanged("ChannelCodeViewMode"); }
}
private CalibrationBehaviors _calibrationBehaviorSetting = CalibrationBehaviors.NonLinearIfAvailable;
public CalibrationBehaviors CalibrationBehaviorSetting
{
get => _calibrationBehaviorSetting;
set { _calibrationBehaviorSetting = value; _eventAggregator.GetEvent<ExportCalibrationBehaviorSettingChangedEvent>().Publish(value); OnPropertyChanged("CalibrationBehaviorSetting"); }
}
private bool _calibrationBehaviorSettableInViewer = true;
public bool CalibrationBehaviorSettableInViewer
{
get => _calibrationBehaviorSettableInViewer;
set
{
_calibrationBehaviorSettableInViewer = value;
_eventAggregator.GetEvent<CalibrationBehaviorSettableInViewerChangedEvent>().Publish(value);
OnPropertyChanged("CalibrationBehaviorSettableInViewer");
((ExportMainViewGrid)View).graphsTab.IsSelected = true;// !value;
}
}
///<summary>
///Occurs when a property value changes.
///</summary>
public new event PropertyChangedEventHandler PropertyChanged;
private new void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); }
private bool _isBusy = false;
/// <summary>
/// Display or hide Busy Indicator
/// </summary>
public new bool IsBusy { get => _isBusy; set { _isBusy = value; OnPropertyChanged("IsBusy"); } }
private string _isBusyMessage = string.Empty;
/// <summary>
/// Busy Message text
/// </summary>
public new string IsBusyMessage { get => _isBusyMessage; set { _isBusyMessage = value; OnPropertyChanged("IsBusyMessage"); } }
private bool _isMenuIncluded = false;
public new bool IsMenuIncluded { get => _isMenuIncluded; set { _isMenuIncluded = value; OnPropertyChanged("IsMenuIncluded"); } }
private bool _isNavigationIncluded = false;
public new bool IsNavigationIncluded { get => _isNavigationIncluded; set { _isNavigationIncluded = value; OnPropertyChanged("IsNavigationIncluded"); } }
/// <summary>
/// Gets the HeaderInfo.
/// </summary>
public string HeaderInfo => "MainRegion";
#endregion
#region Commands
#region LoadLayoutCommand
RelayCommand _loadLayoutCommand = null;
public ICommand LoadLayoutCommand => _loadLayoutCommand ?? (_loadLayoutCommand = new RelayCommand(OnLoadLayout, CanLoadLayout));
private bool CanLoadLayout(object parameter)
{
return File.Exists(@".\DataProViewerAvalonDock.config");
}
private void OnLoadLayout(object parameter)
{
var layoutSerializer = new XmlLayoutSerializer(((ExportMainView)View).DockManager);
//Here I've implemented the LayoutSerializationCallback just to show
// a way to feed layout desarialization with content loaded at runtime
//Actually I could in this case let AvalonDock to attach the contents
//from current layout using the content ids
//LayoutSerializationCallback should anyway be handled to attach contents
//not currently loaded
layoutSerializer.LayoutSerializationCallback += (s, e) =>
{
};
layoutSerializer.Deserialize(@".\DataProViewerAvalonDock.config");
}
#endregion
#region SaveLayoutCommand
RelayCommand _saveLayoutCommand = null;
public ICommand SaveLayoutCommand => _saveLayoutCommand ?? (_saveLayoutCommand = new RelayCommand(OnSaveLayout, CanSaveLayout));
private bool CanSaveLayout(object parameter)
{
return true;
}
private void OnSaveLayout(object parameter)
{
var layoutSerializer = new XmlLayoutSerializer(((ExportMainView)View).DockManager);
layoutSerializer.Serialize(@".\AvalonDock.config");
}
#endregion
#endregion
}
}

View File

@@ -0,0 +1,311 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Windows;
using DTS.Common;
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interface;
using DTS.Common.Utils;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Unity;
namespace DTS.Viewer
{
public class MainViewModel : BaseViewModel<IMainViewModel>, IMainViewModel
{
public IBaseView View { get; private set; }
private IBaseWindowModel Parent { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private new IRegionManager _regionManager;
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the MainViewModel.
/// </summary>
/// <param name="view">The MainView View.</param>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The Unity container.</param>
public MainViewModel(IMainView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
View = view;
View.DataContext = this;
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
_unityContainer = unityContainer;
_regionManager = regionManager;
_eventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification);
}
#region Methods
/// <summary>
/// Initialize without parameter
/// </summary>
public override void Initialize()
{
}
/// <summary>
/// Initialize with parameter - Parent
/// </summary>
public override void Initialize(object parameter)
{
Parent = (IBaseWindowModel)parameter;
Parent.IsMenuIncluded = _isMenuIncluded;
Parent.IsNavigationIncluded = _isNavigationIncluded;
_eventAggregator.GetEvent<AssemblyListNotification>().Subscribe(OnAssemblyListChange, ThreadOption.PublisherThread, true);
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Subscribe(OnBusyIndicatorNotification, ThreadOption.PublisherThread, true);
View.DataContext = this;
}
public override void Activated()
{
}
/// <summary>
/// Display loaded assemblies
/// </summary>
/// <param name="e">List of loaded assemblies</param>
private void OnAssemblyListChange(AssemblyListInfo e)
{
var assemblyList = new List<AssemblyNameImage>();
foreach (var assembly in e.AssemblyList)
{
assemblyList.AddRange(from attribute in assembly.GetCustomAttributes()
where attribute.GetType().Name.EndsWith("ImageAttribute")
select new AssemblyNameImage
{
AssemblyGroup = ((ImageAttribute)attribute).GetAssemblyGroup(),
AssemblyName = Regex.Replace(((ImageAttribute)attribute).GetAssemblyName(), "(\\B[A-Z])", " $1"),
AssemblyImage = ((ImageAttribute)attribute).GetAssemblyImage(),
AssemblyRegion = ((ImageAttribute)attribute).GetAssemblyRegion()
});
}
foreach (var assembly in assemblyList)
{
switch (assembly.AssemblyRegion)
{
case eAssemblyRegion.NavigationRegion:
break;
case eAssemblyRegion.GraphRegion:
ContextGraphRegion = GetGraphView(Parent);
break;
case eAssemblyRegion.StatsRegion:
break;
case eAssemblyRegion.CursorRegion:
break;
case eAssemblyRegion.DiagRegion:
break;
case eAssemblyRegion.TestsRegion:
break;
case eAssemblyRegion.GraphsRegion:
break;
case eAssemblyRegion.LegendRegion:
break;
case eAssemblyRegion.PropertyRegion:
ContextPropertyRegion = GetPropertyView(Parent);
break;
}
}
}
/// <summary>
/// Private Event handler for RaiseNotification event.
/// </summary>
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
{
// Notification object expects a NotificationContentEventArgsWithoutTitle object and a Title string.
var eventArgsWithoutTitle = new NotificationContentEventArgs(eventArgsWithTitle.Message, eventArgsWithTitle.MessageDetails, eventArgsWithTitle.Image);
NotificationRequest.Raise(new Notification
{
Content = eventArgsWithoutTitle,
Title = eventArgsWithTitle.Title
});
}
/// <summary>
/// Private Event handler for RaiseNotification event.
/// </summary>
private void OnBusyIndicatorNotification(bool eventArg)
{
IsBusy = eventArg;
}
#endregion
#region Views
private INavigationView GetNavigationView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<INavigationView>();
var viewModel = _unityContainer.Resolve<INavigationViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private IPropertyView GetPropertyView(IBaseWindowModel parent)
{
var view = _unityContainer.Resolve<IPropertyView>();
var viewModel = _unityContainer.Resolve<IPropertyViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private IGraphView GetGraphView(IBaseWindowModel parent)
{
var view = _unityContainer.Resolve<IGraphView>();
var viewModel = _unityContainer.Resolve<IGraphViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
#endregion Views
#region ContextRegion
public object ContextNavigationRegion
{
get { return ((MainView)View).NavigationRegion.Content; }
set { ((MainView)View).NavigationRegion.Content = value; OnPropertyChanged("ContextNavigationRegion"); }
}
#region Graph
public object ContextGraphRegion
{
get { return ((MainView)View).GraphRegion.Content; }
set { ((MainView)View).GraphRegion.Content = value; OnPropertyChanged("ContextGraphsRegion"); }
}
#endregion Graph
public object ContextTestsRegion
{
get { return ((MainView)View).TestsRegion.Content; }
set { ((MainView)View).TestsRegion.Content = value; OnPropertyChanged("ContextTestsRegion"); }
}
public object ContextGraphsRegion
{
get { return ((MainView)View).GraphsRegion.Content; }
set { ((MainView)View).GraphsRegion.Content = value; OnPropertyChanged("ContextGraphsRegion"); }
}
public object ContextLegendRegion
{
get { return ((MainView)View).LegendRegion.Content; }
set { ((MainView)View).LegendRegion.Content = value; OnPropertyChanged("ContextLegendRegion"); }
}
public object ContextDiagRegion
{
get { return ((MainView)View).DiagRegion.Content; }
set { ((MainView)View).DiagRegion.Content = value; OnPropertyChanged("ContextDiagRegion"); }
}
public object ContextStatsRegion
{
get { return ((MainView)View).StatsRegion.Content; }
set { ((MainView)View).StatsRegion.Content = value; OnPropertyChanged("ContextStatsRegion"); }
}
public object ContextCursorRegion
{
get { return ((MainView)View).CursorRegion.Content; }
set { ((MainView)View).CursorRegion.Content = value; OnPropertyChanged("ContextCursorRegion"); }
}
public object ContextPropertyRegion
{
get { return ((MainView)View).PropertyRegion.Content; }
set { ((MainView)View).PropertyRegion.Content = value; OnPropertyChanged("ContextPropertyRegion"); }
}
public List<FrameworkElement> GetRegions()
{
var items = new List<FrameworkElement>();
Utils.GetChildrenByName(((MainView)View).MainShell, "Region", ref items);
return items;
}
#endregion
#region Properties
//List<IGroupView> _assemblyGroupList = new List<IGroupView>();
//public List<IGroupView> AssemblyGroupList
//{
// get { return _assemblyGroupList; }
// set { _assemblyGroupList = value; OnPropertyChanged("AssemblyGroupList"); }
//}
///<summary>
///Occurs when a property value changes.
///</summary>
public new event PropertyChangedEventHandler PropertyChanged;
private new void OnPropertyChanged(string propertyName)
{
var eventHandler = PropertyChanged;
if (eventHandler != null)
{
eventHandler(this, new PropertyChangedEventArgs(propertyName));
}
}
private bool _isBusy = false;
public new bool IsBusy
{
get { return _isBusy; }
set { _isBusy = value; OnPropertyChanged("IsBusy"); }
}
private string _isBusyMessage = string.Empty;
public new string IsBusyMessage { get { return _isBusyMessage; } set { _isBusyMessage = value; OnPropertyChanged("IsBusyMessage"); } }
private bool _isMenuIncluded = false;
public new bool IsMenuIncluded
{
get { return _isMenuIncluded; }
set
{
_isMenuIncluded = value;
OnPropertyChanged("IsMenuIncluded");
}
}
private bool _isNavigationIncluded = false;
public new bool IsNavigationIncluded
{
get { return _isNavigationIncluded; }
set
{
_isNavigationIncluded = value;
OnPropertyChanged("IsNavigationIncluded");
}
}
/// <summary>
/// Gets the HeaderInfo.
/// </summary>
public string HeaderInfo { get { return "MainRegion"; } }
#endregion
}
}

View File

@@ -0,0 +1,626 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text.RegularExpressions;
using System.Windows;
using System.Windows.Input;
using System.Windows.Threading;
using DTS.Common;
using DTS.Common.Base;
using DTS.Common.Classes.Viewer.Commands;
using DTS.Common.Enums;
using DTS.Common.Enums.Sensors;
using DTS.Common.Events;
using DTS.Common.Interface;
using DTS.Common.Utils;
using DTS.Common.Settings;
using DTS.Viewer.Resources;
using Xceed.Wpf.AvalonDock.Layout;
using Xceed.Wpf.AvalonDock.Layout.Serialization;
using System.Globalization;
using DTS.Common.Interactivity;
using Prism.Regions;
using Prism.Events;
using Unity;
// ReSharper disable CheckNamespace
// ReSharper disable InconsistentNaming
// ReSharper disable NotAccessedField.Local
// ReSharper disable UnusedMember.Local
// ReSharper disable RedundantDefaultMemberInitializer
namespace DTS.Viewer
{
public class ViewerMainViewModel : BaseViewModel<IViewerMainViewModel>, IViewerMainViewModel
{
public IBaseView View { get; set; }
private IBaseWindowModel Parent { get; set; }
private IEventAggregator _eventAggregator { get; set; }
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public new InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the MainViewModel.
/// </summary>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The Unity container.</param>
public ViewerMainViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
: base(regionManager, eventAggregator, unityContainer)
{
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
_unityContainer = unityContainer;
View = _unityContainer.Resolve<IViewerMainViewGrid>();
View.DataContext = this;
}
#region Methods
/// <summary>
/// sets SelectedDataFile and marks it as selected in viewer/model
/// 16158 Browse button on View Data tab not functiona
/// </summary>
public void SelectAndIncludeDataFile(string value)
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFile = value;
_eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg
{ Path = string.Empty, File = _selectedDataFile, SetSelected = true, ParentVM = this });
OnPropertyChanged("SelectedDataFile");
}
private void OnDataFileSelected(DataFileSelectionArg arg)
{
if (this != arg.ParentVM) return;
SelectAndIncludeDataFile(arg?.File);
}
private void Subscribe()
{
_eventAggregator.GetEvent<LoadViewModulEvent>().Subscribe(OnLoadViewModul, ThreadOption.PublisherThread, true);
_eventAggregator.GetEvent<TestLoadedCountNotification>().Subscribe(OnTestLoadedChanged);
_eventAggregator.GetEvent<TestSummaryCountNotification>().Subscribe(OnTestSelectedCountChanged);
_eventAggregator.GetEvent<GraphLoadedCountNotification>().Subscribe(OnGraphLoadedCountChanged);
_eventAggregator.GetEvent<ShiftT0Event>().Subscribe(OnShiftT0Event);
_eventAggregator.GetEvent<GraphSelectedChannelCountNotification>().Subscribe(OnGraphSelectedCountChanged);
_eventAggregator.GetEvent<GraphChannelsReadCompletedNotification>().Subscribe(OnGraphChannelsReadCompleted, ThreadOption.UIThread);
_eventAggregator.GetEvent<ViewerSettingsVisibilityChangedEvent>().Subscribe(OnViewerSettingsVisibilityChanged);
_eventAggregator.GetEvent<DataFileSelectedEvent>().Subscribe(OnDataFileSelected);
_eventAggregator.GetEvent<SaveToPDFRequestedEvent>().Subscribe(OnSaveToPDFRequested);
}
private void OnViewerSettingsVisibilityChanged(Visibility settingsVisibility)
{
SettingsVisibility = settingsVisibility;
}
private Visibility _settingsVisibility = Visibility.Visible;
public Visibility SettingsVisibility
{
get => _settingsVisibility;
private set
{
_settingsVisibility = value;
OnPropertyChanged("SettingsVisibility");
}
}
/// <summary>
/// Initialize without parameter
/// </summary>
public override void Initialize()
{
Subscribe();
}
/// <summary>
/// Initialize with parameter - Parent
/// </summary>
public override void Initialize(object parameter)
{
Parent = (IBaseWindowModel)parameter;
Parent.IsMenuIncluded = _isMenuIncluded;
Parent.IsNavigationIncluded = _isNavigationIncluded;
Subscribe();
View.DataContext = this;
}
public override void Activated()
{
}
private void OnGraphLoadedCountChanged(GraphLoadedCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalLoadedGraphs = arg.LoadedCount;
}
private void OnGraphSelectedCountChanged(GraphSelectedChannelCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalSelectedGraphs = arg.SelectedChannelCount;
}
private void OnGraphChannelsReadCompleted(GraphChannelsReadCompletedNotificationArgs arg)
{
if (null == arg) { return; }
if (((IGraphView)ContextGraphRegion).DataContext != arg?.GraphVM) return;
_eventAggregator.GetEvent<BusyIndicatorChangeNotification>().Publish(!arg.IsReadCompleted);
}
private void OnTestLoadedChanged(TestLoadedCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalLoadedTests = arg.LoadedCount;
}
private void OnTestSelectedCountChanged(TestSummaryCountNotificationArg arg)
{
if (this != arg?.ParentVM) return;
TotalSelectedTests = arg.SummaryCount;
}
/// <summary>
/// Private Event handler for Status change event.
/// </summary>
private void OnStatusChange(StatusInfo content)
{
Dispatcher.CurrentDispatcher.InvokeAsync(() =>
{
IsBusy = content.IsBusy;
IsBusyMessage = content.Text;
}, DispatcherPriority.Normal);
}
private void OnLoadViewModul(LoadViewModulArg arg)
{
IsBusy = true;
IsBusyMessage = "Loading view list";
if (null == ContextGraphRegion) ContextGraphRegion = GetGraphView(this);
if (null == ContextTestsRegion) ContextTestsRegion = GetTestDefinitionView(this);
if (null == ContextGraphListRegion) ContextGraphListRegion = GetGraphListView(this);
if (null == ContextChartOptionsRegion) ContextChartOptionsRegion = GetChartOptionsView(this);
if (null == ContextTestModificationRegion) ContextTestModificationRegion = GetTestModificationView(this);
if (null == ContextViewerSettingsRegion) ContextViewerSettingsRegion = GetViewerSettingsView(this);
IsBusy = false;
IsBusyMessage = string.Empty;
}
public void ZoomReset()
{
_eventAggregator.GetEvent<ResetZoomChangedEvent>().Publish(true);
}
public void LeftKeyPress()
{
//inform any other modules and models of a T0 shift
_eventAggregator.GetEvent<ShiftT0Event>().Publish(new ShiftT0EventArguments(-1, false, true));
}
public void RightKeyPress()
{
//inform any other modules and models of a T0 shift
_eventAggregator.GetEvent<ShiftT0Event>().Publish(new ShiftT0EventArguments(1, false, true));
}
private void OnShiftT0Event(ShiftT0EventArguments args)
{
if (args.IsInitialization) { return; }
if (args.T0Time != 0) { ShowModifications = true; }
if (args.T0Steps != 0) { ShowModifications = true; }
}
#endregion
#region Views
private INavigationView GetNavigationView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<INavigationView>();
var viewModel = _unityContainer.Resolve<INavigationViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private INavigationViewModel GetNavigationViewModel(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<INavigationView>();
var viewModel = _unityContainer.Resolve<INavigationViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return viewModel;
}
private IChartOptionsView GetChartOptionsView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IChartOptionsView>();
var viewModel = _unityContainer.Resolve<IChartOptionsViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private IGraphView GetGraphView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IGraphView>();
var viewModel = _unityContainer.Resolve<IGraphViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private IGraphMainView GetGraphListView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IGraphMainView>();
var viewModel = _unityContainer.Resolve<IGraphMainViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private IViewerSettingsView GetViewerSettingsView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<IViewerSettingsView>();
var viewModel = _unityContainer.Resolve<IViewerSettingsViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
private ITestModificationView GetTestModificationView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<ITestModificationView>();
var viewModel = _unityContainer.Resolve<ITestModificationViewModel>();
view.DataContext = viewModel;
try
{
viewModel.UseISOCodeFilterMapping = SettingsDB.GetGlobalValueBool("UseISOCodeFilterMapping", true);
}
catch (Exception)
{
}
viewModel.Initialize(parent);
return view;
}
private ITestSummaryListView GetTestDefinitionView(IBaseViewModel parent)
{
var view = _unityContainer.Resolve<ITestSummaryListView>();
var viewModel = _unityContainer.Resolve<ITestSummaryListViewModel>();
view.DataContext = viewModel;
viewModel.Initialize(parent);
return view;
}
#endregion Views
#region ContextRegion
private IBaseViewModel _activeContent;
public IBaseViewModel ActiveContent { get => _activeContent; set { _activeContent = value; OnPropertyChanged("ActiveContent"); } }
#region Graph
public object ContextGraphRegion
{
get => ((ViewerMainViewGrid)View).GraphRegion.Content;
set { ((ViewerMainViewGrid)View).GraphRegion.Content = value; OnPropertyChanged("ContextGraphRegion"); }
}
public object ContextGraphListRegion
{
get => ((ViewerMainViewGrid)View).GraphListRegion.Content;
set { ((ViewerMainViewGrid)View).GraphListRegion.Content = value; OnPropertyChanged("ContextGraphListRegion"); }
}
#endregion Graph
public object ContextTestsRegion
{
get => ((ViewerMainViewGrid)View).TestsRegion.Content;
set { ((ViewerMainViewGrid)View).TestsRegion.Content = value; OnPropertyChanged("ContextTestsRegion"); }
}
public object ContextGraphsRegion
{
get => ((ViewerMainViewGrid)View).GraphListRegion.Content;
set { ((ViewerMainViewGrid)View).GraphListRegion.Content = value; OnPropertyChanged("ContextGraphsRegion"); }
}
public object ContextLegendRegion
{
get => ((ViewerMainViewGrid)View).LegendRegion.Content;
set { ((ViewerMainViewGrid)View).LegendRegion.Content = value; OnPropertyChanged("ContextLegendRegion"); }
}
public object ContextDiagRegion
{
get => ((ViewerMainViewGrid)View).DiagRegion.Content;
set { ((ViewerMainViewGrid)View).DiagRegion.Content = value; OnPropertyChanged("ContextDiagRegion"); }
}
public object ContextStatsRegion
{
get => ((ViewerMainViewGrid)View).StatsRegion.Content;
set { ((ViewerMainViewGrid)View).StatsRegion.Content = value; OnPropertyChanged("ContextStatsRegion"); }
}
public object ContextCursorRegion
{
get =>((ViewerMainViewGrid)View).CursorRegion.Content;
set { ((ViewerMainViewGrid)View).CursorRegion.Content = value; OnPropertyChanged("ContextCursorRegion"); }
}
public object ContextPropertyRegion { get; set; }
public object ContextChartOptionsRegion
{
get => ((ViewerMainViewGrid)View).ChartOptionsRegion.Content;
set { ((ViewerMainViewGrid)View).ChartOptionsRegion.Content = value; OnPropertyChanged("ContextChartOptionsRegion"); }
}
public object ContextTestModificationRegion
{
get => ((ViewerMainViewGrid)View).TestModificationRegion.Content;
set { ((ViewerMainViewGrid)View).TestModificationRegion.Content = value; OnPropertyChanged("ContextTestModificationRegion"); }
}
public object ContextViewerSettingsRegion
{
get => ((ViewerMainViewGrid)View).SettingsRegion.Content;
set { ((ViewerMainViewGrid)View).SettingsRegion.Content = value; OnPropertyChanged("ContextViewerSettingsRegion"); }
}
public List<FrameworkElement> GetRegions()
{
var items = new List<FrameworkElement>();
Utils.GetChildrenByName(((ViewerMainViewGrid)View).MainShell, "Region", ref items);
return items;
}
private readonly object saveLock = new object();
private void OnSaveToPDFRequested(string directory)
{
if (null == (ViewerMainViewGrid)View) return;
lock (saveLock)
{
var pdfFileName = DateTime.Now.ToString("M'/'d'/'yyyy", CultureInfo.InvariantCulture).Replace("/", "_") + "_" +
DateTime.Now.ToString("h':'mm' 'tt", CultureInfo.InvariantCulture).Replace(":", "_") + "_" + DateTime.Now.Second + "_" +
DateTime.Now.Millisecond + ".pdf";
var intResult = ((ViewerMainViewGrid)View).SaveToPDF(directory, pdfFileName);
var output = string.Empty;
if (intResult > 0)
{
//Success
output = string.Format(StringResources.SavePDFSuccess, Environment.NewLine,
Path.Combine(directory, pdfFileName), Environment.NewLine,
Path.Combine(directory, pdfFileName.Replace(".pdf", ".png")));
_eventAggregator.GetEvent<PageErrorEvent>().Publish(new PageErrorArg(new string[] { output }, null));
}
else if (intResult < 0)
{
//Failure
output = StringResources.SavePDFError;
_eventAggregator.GetEvent<PageErrorEvent>().Publish(new PageErrorArg(new string[] { output }, null));
}
}
}
public string ConfigPath { get; set; }
#endregion
#region Properties
#region Test Title
private string _titleTests = StringResources.TestsDefaultTitle;
public string TitleTests
{
get => _titleTests;
set
{
_titleTests = value;
OnPropertyChanged("TitleTests");
}
}
private int _totalSelectedTests = 0;
public int TotalSelectedTests
{
get => _totalSelectedTests;
set
{
_totalSelectedTests = value;
TitleTests = StringResources.TestsDefaultTitle + TotalSelectedTests + "/" + TotalLoadedTests;
if (_totalSelectedTests == 0) { TitleGraphs = StringResources.GraphsDefaultTitle; }
OnPropertyChanged("TotalSelectedTests");
}
}
private int _totalLoadedTests = 0;
public int TotalLoadedTests
{
get => _totalLoadedTests;
set { _totalLoadedTests = value; TitleTests = StringResources.TestsDefaultTitle + TotalSelectedTests + "/" + TotalLoadedTests; OnPropertyChanged("TotalLoadedTests"); }
}
#endregion Test Title
#region Graph Title
private string _titleGraphs = StringResources.GraphsDefaultTitle;
public string TitleGraphs
{
get => _titleGraphs;
set
{
_titleGraphs = value;
OnPropertyChanged("TitleGraphs");
}
}
private int _totalSelectedGraphs = 0;
public int TotalSelectedGraphs
{
get => _totalSelectedGraphs;
set { _totalSelectedGraphs = value; TitleGraphs = StringResources.GraphsDefaultTitle + TotalSelectedGraphs + "/" + TotalLoadedGraphs; OnPropertyChanged("TotalSelectedGraphs"); }
}
private int _totalLoadedGraphs = 0;
public int TotalLoadedGraphs
{
get => _totalLoadedGraphs;
set { _totalLoadedGraphs = value; TitleGraphs = StringResources.GraphsDefaultTitle + TotalSelectedGraphs + "/" + TotalLoadedGraphs; OnPropertyChanged("TotalLoadedGraphs"); }
}
#endregion Graph Title
private string _selectedDataFolder = string.Empty;
public string SelectedDataFolder
{
get => _selectedDataFolder;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFolder = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = _selectedDataFolder, File = string.Empty, ParentVM = this }); OnPropertyChanged("SelectedDataFolder");
}
}
public bool DoesUserHaveEditPermission { get; set; } = false;
private string _selectedDataFile = string.Empty;
public string SelectedDataFile
{
get => _selectedDataFile;
set
{
if (string.IsNullOrEmpty(value)) return;
_selectedDataFile = value; _eventAggregator.GetEvent<DataFolderChangedEvent>().Publish(new DataFolderSelectionArg { Path = string.Empty, File = _selectedDataFile, ParentVM = this }); OnPropertyChanged("SelectedDataFile");
}
}
public bool _showModifications = false;
public bool ShowModifications
{
get => _showModifications;
set { _showModifications = value; OnPropertyChanged("ShowModifications"); }
}
private IsoViewMode _channelCodeViewMode = IsoViewMode.ISOAndUserCode;
public IsoViewMode ChannelCodeViewMode
{
get => _channelCodeViewMode;
set { _channelCodeViewMode = value; _eventAggregator.GetEvent<ChannelCodesViewChangedEvent>().Publish(value); OnPropertyChanged("ChannelCodeViewMode"); }
}
private CalibrationBehaviors _calibrationBehaviorSetting = CalibrationBehaviors.NonLinearIfAvailable;
public CalibrationBehaviors CalibrationBehaviorSetting
{
get => _calibrationBehaviorSetting;
set { _calibrationBehaviorSetting = value; _eventAggregator.GetEvent<CalibrationBehaviorSettingChangedEvent>().Publish(value); OnPropertyChanged("CalibrationBehaviorSetting"); }
}
private bool _calibrationBehaviorSettableInViewer = true;
public bool CalibrationBehaviorSettableInViewer
{
get => _calibrationBehaviorSettableInViewer;
set
{
_calibrationBehaviorSettableInViewer = value;
_eventAggregator.GetEvent<CalibrationBehaviorSettableInViewerChangedEvent>().Publish(value);
OnPropertyChanged("CalibrationBehaviorSettableInViewer");
//FB13946: Test tab should be the first if in Viewer Tile, graphs tab if in Run Test/Download
//CalibrationSettableInViewer is a proxy here for which tile we're in
((ViewerMainViewGrid)View).graphsTab.IsSelected = !value;
((ViewerMainViewGrid)View).testsTab.IsSelected = value;
//FB 14797 select first tab always to not switch when the graph is loading.
((ViewerMainViewGrid)View).chartOptTab.IsSelected = true;
((ViewerMainViewGrid)View).chartOptTab.Focusable = true;
((ViewerMainViewGrid)View).chartOptTab.Focus();
}
}
//List<IGroupView> _assemblyGroupList = new List<IGroupView>();
//public List<IGroupView> AssemblyGroupList
//{
// get { return _assemblyGroupList; }
// set { _assemblyGroupList = value; OnPropertyChanged("AssemblyGroupList"); }
//}
///<summary>
///Occurs when a property value changes.
///</summary>
public new event PropertyChangedEventHandler PropertyChanged;
private new void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); }
private bool _isBusy = false;
/// <summary>
/// Display or hide Busy Indicator
/// </summary>
public new bool IsBusy { get => _isBusy; set { _isBusy = value; OnPropertyChanged("IsBusy"); } }
private string _isBusyMessage = string.Empty;
/// <summary>
/// Busy Message text
/// </summary>
public new string IsBusyMessage { get => _isBusyMessage; set { _isBusyMessage = value; OnPropertyChanged("IsBusyMessage"); } }
private bool _isMenuIncluded = false;
public new bool IsMenuIncluded { get => _isMenuIncluded; set { _isMenuIncluded = value; OnPropertyChanged("IsMenuIncluded"); } }
private bool _isNavigationIncluded = false;
public new bool IsNavigationIncluded { get => _isNavigationIncluded; set { _isNavigationIncluded = value; OnPropertyChanged("IsNavigationIncluded"); } }
/// <summary>
/// Gets the HeaderInfo.
/// </summary>
public string HeaderInfo => "MainRegion";
#endregion
#region Commands
#region LoadLayoutCommand
RelayCommand _loadLayoutCommand = null;
public ICommand LoadLayoutCommand => _loadLayoutCommand ?? (_loadLayoutCommand = new RelayCommand(OnLoadLayout, CanLoadLayout));
private bool CanLoadLayout(object parameter)
{
return File.Exists(@".\DataProViewerAvalonDock.config");
}
private void OnLoadLayout(object parameter)
{
var layoutSerializer = new XmlLayoutSerializer(((ViewerMainView)View).DockManager);
//Here I've implemented the LayoutSerializationCallback just to show
// a way to feed layout desarialization with content loaded at runtime
//Actually I could in this case let AvalonDock to attach the contents
//from current layout using the content ids
//LayoutSerializationCallback should anyway be handled to attach contents
//not currently loaded
layoutSerializer.LayoutSerializationCallback += (s, e) =>
{
//if (e.Model.ContentId == FileStatsViewModel.ToolContentId)
// e.Content = Workspace.This.FileStats;
//else if (!string.IsNullOrWhiteSpace(e.Model.ContentId) &&
// File.Exists(e.Model.ContentId))
// e.Content = Workspace.This.Open(e.Model.ContentId);
};
layoutSerializer.Deserialize(@".\DataProViewerAvalonDock.config");
}
#endregion
#region SaveLayoutCommand
RelayCommand _saveLayoutCommand = null;
public ICommand SaveLayoutCommand => _saveLayoutCommand ?? (_saveLayoutCommand = new RelayCommand(OnSaveLayout, CanSaveLayout));
public object ContextNavigationRegion { get; set; }
private bool CanSaveLayout(object parameter)
{
return true;
}
private void OnSaveLayout(object parameter)
{
var layoutSerializer = new XmlLayoutSerializer(((ViewerMainView)View).DockManager);
layoutSerializer.Serialize(@".\AvalonDock.config");
}
#endregion
#endregion
}
}

View File

@@ -0,0 +1,187 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Composition;
using System.Threading.Tasks;
using System.Windows;
using DTS.Common.Base;
using DTS.Common.Events;
using DTS.Common.Interface;
using Microsoft.Practices.Prism.Events;
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
using Microsoft.Practices.Unity;
using DTS.Common.Utils;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.Prism.ViewModel;
namespace DTS.Viewer
{
[Export(typeof(IShellView))]
[PartCreationPolicy(CreationPolicy.Shared)]
public class ViewerShellViewModel : NotificationObject, IViewerShellViewModel
{
//BaseViewModel<ShellViewModel>,
public IViewerShellView View { get; private set; }
private IEventAggregator _eventAggregator { get; set; }
private IRegionManager _regionManager;
private IUnityContainer _unityContainer { get; set; }
public InteractionRequest<Notification> NotificationRequest { get; private set; }
public InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
/// <summary>
/// Creates a new instance of the TechnologyDomainEditViewModel.
/// </summary>
/// <param name="view">The ShellView View.</param>
/// <param name="regionManager">The logical placeholder defined within the application's UI (in the shell or within views) into which views are displayed.</param>
/// <param name="eventAggregator">The EventAggregator which allows different components to publish/subscribe to events without being coupled to each other.</param>
/// <param name="unityContainer">The unityContainer.</param>
public ViewerShellViewModel(IViewerShellView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
//: base(regionManager, eventAggregator, unityContainer)
{
View = view;
View.DataContext = this;
NotificationRequest = new InteractionRequest<Notification>();
ConfirmationRequest = new InteractionRequest<Confirmation>();
_eventAggregator = eventAggregator;
_unityContainer = unityContainer;
_regionManager = regionManager;
_eventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification);
_unityContainer .RegisterType<IMainView, MainView>();
_unityContainer .RegisterType<IMainViewModel, MainViewModel>(new ContainerControlledLifetimeManager());
}
#region Methods
public void Initialize()
{
int i = 10;
}
public void Initialize(object parameter)
{
int i = 22;
}
public void Initialize(object parameter, object model)
{
}
bool IBaseViewModel.IsBusy { get; set; }
public void Activated()
{
var s = String.Empty;
}
/// <summary>
/// Private Event handler for RaiseNotification event.
/// </summary>
private void OnRaiseNotification(NotificationContentEventArgs eventArgsWithTitle)
{
// The NotificationRequest.Raise triggers the Invoke() method of the .Infrastructure.PopupWindowAction object to show the .Infrastructure.NotificationWindow window
// Notification object expects a NotificationContentEventArgsWithoutTitle object and a Title string.
var eventArgsWithoutTitle = new NotificationContentEventArgs(eventArgsWithTitle.Message, eventArgsWithTitle.MessageDetails, eventArgsWithTitle.Image);
NotificationRequest.Raise(new Notification { Content = eventArgsWithoutTitle, Title = eventArgsWithTitle.Title });
}
#endregion
#region ContextRegion
/// <summary>
/// Returns all regions in the main grid
/// </summary>
/// <returns></returns>
public List<FrameworkElement> GetRegions()
{
var items = new List<FrameworkElement>();
Utils.GetChildrenByName(((ViewerShellView)View).MainShell, "Region", ref items);
return items;
}
public Object ContextMainRegion
{
get { return ((ViewerShellView)View).MainRegion.Content; }
set { ((ViewerShellView)View).MainRegion.Content = value; OnPropertyChanged("ContextMainRegion"); }
}
#endregion
#region Properties
private bool _isMenuIncluded = false;
public bool IsMenuIncluded
{
get { return _isMenuIncluded; }
set
{
_isMenuIncluded = value;
OnPropertyChanged("IsMenuIncluded");
}
}
private bool _isNavigationIncluded = false;
public bool IsNavigationIncluded
{
get { return _isNavigationIncluded; }
set
{
_isNavigationIncluded = value;
OnPropertyChanged("IsNavigationIncluded");
}
}
/// <summary>
/// Gets the HeaderInfo.
/// </summary>
public string HeaderInfo { get { return "MainRegion"; } }
#endregion Properties
///<summary>
///Occurs when a property value changes.
///</summary>
public event PropertyChangedEventHandler PropertyChanged;
private void OnPropertyChanged(string propertyName)
{
PropertyChangedEventHandler eventHandler = this.PropertyChanged;
if (eventHandler != null)
{
eventHandler(this, new PropertyChangedEventArgs(propertyName));
}
}
public bool IsBusy
{
get { throw new NotImplementedException(); }
}
public bool IsDirty
{
get { throw new NotImplementedException(); }
}
public void Cleanup()
{
throw new NotImplementedException();
}
public Task CleanupAsync()
{
throw new NotImplementedException();
}
public Task InitializeAsync()
{
throw new NotImplementedException();
}
public Task InitializeAsync(object parameter)
{
throw new NotImplementedException();
}
}
}