init
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
<base:BaseWindow x:Class="DTS.Viewer.View.ShellView"
|
||||
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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
|
||||
<Profiles />
|
||||
<Settings />
|
||||
</SettingsFile>
|
||||
@@ -0,0 +1,23 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
/// <summary>
|
||||
/// XAML Row Style Color support class
|
||||
/// </summary>
|
||||
public class BindingProxy : Freezable
|
||||
{
|
||||
protected override Freezable CreateInstanceCore()
|
||||
{
|
||||
return new BindingProxy();
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty DataProperty = DependencyProperty.Register("Data", typeof(object), typeof(BindingProxy), new PropertyMetadata(default(object)));
|
||||
|
||||
public object Data
|
||||
{
|
||||
get { return (object)GetValue(DataProperty); }
|
||||
set { SetValue(DataProperty, value); }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<base:BaseView x:Class="DTS.Viewer.DockPanelVerticalView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common">
|
||||
<DockPanel Dock="Bottom" MinWidth="1000" MinHeight="150">
|
||||
<TabControl Margin="0,5,0,0" HorizontalAlignment="Stretch">
|
||||
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</base:BaseView>
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace DTS.Viewer.Classes
|
||||
{
|
||||
class TabItem
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{F1AEA231-F29E-4EAB-9EA9-5355EBDECD6E}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>DTS.Viewer</RootNamespace>
|
||||
<AssemblyName>DTS.Viewer</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkProfile>
|
||||
</TargetFrameworkProfile>
|
||||
<SccProjectName>
|
||||
</SccProjectName>
|
||||
<SccLocalPath>
|
||||
</SccLocalPath>
|
||||
<SccAuxPath>
|
||||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<StartupObject>
|
||||
</StartupObject>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<OutputPath>bin\x64\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x64</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||
<OutputPath>bin\x86\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<Optimize>true</Optimize>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="C1.WPF.4, Version=4.0.20203.727, Culture=neutral, PublicKeyToken=2aa4ec5576d6c3ce, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files (x86)\ComponentOne\WPF Edition\bin\v4\C1.WPF.4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="C1.WPF.C1Chart.4, Version=4.0.20203.727, Culture=neutral, PublicKeyToken=2aa4ec5576d6c3ce, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files (x86)\ComponentOne\WPF Edition\bin\v4\C1.WPF.C1Chart.4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="C1.WPF.C1Chart.Extended.4, Version=4.0.20203.727, Culture=neutral, PublicKeyToken=2aa4ec5576d6c3ce, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files (x86)\ComponentOne\WPF Edition\bin\v4\C1.WPF.C1Chart.Extended.4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="C1.WPF.Pdf.4, Version=4.0.20203.727, Culture=neutral, PublicKeyToken=2aa4ec5576d6c3ce, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\Program Files (x86)\ComponentOne\WPF Edition\bin\v4\C1.WPF.Pdf.4.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xaml.Behaviors">
|
||||
<HintPath>..\..\Common\DTS.Common\lib\PrismLibrary\Microsoft.Xaml.Behaviors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism">
|
||||
<HintPath>..\..\Common\DTS.Common\lib\PrismLibrary\Prism.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism.Unity.Wpf">
|
||||
<HintPath>..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Unity.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Prism.Wpf">
|
||||
<HintPath>..\..\Common\DTS.Common\lib\PrismLibrary\Prism.Wpf.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Composition" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Common\DTS.Common\lib\System.Windows.Interactivity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Abstractions">
|
||||
<HintPath>..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Abstractions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Unity.Container">
|
||||
<HintPath>..\..\Common\DTS.Common\lib\PrismLibrary\Unity.Container.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="Xceed.Wpf.AvalonDock, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.AvalonDock.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Aero, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.AvalonDock.Themes.Aero.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.Metro, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.AvalonDock.Themes.Metro.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.AvalonDock.Themes.VS2010, Version=3.0.0.0, Culture=neutral, PublicKeyToken=3e4669d2f30244f4, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.AvalonDock.Themes.VS2010.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Xceed.Wpf.Toolkit">
|
||||
<HintPath>..\..\Common\DTS.Common\lib\Xceed.Wpf.Toolkit\Xceed.Wpf.Toolkit.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ExportModule.cs" />
|
||||
<Compile Include="Modules\Main\ViewModel\ExportMainViewModel.cs" />
|
||||
<Compile Include="Modules\Main\ViewModel\ViewerMainViewModel.cs" />
|
||||
<Compile Include="Modules\Main\View\ExportMainView.xaml.cs">
|
||||
<DependentUpon>ExportMainView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Modules\Main\View\ExportMainViewGrid.xaml.cs">
|
||||
<DependentUpon>ExportMainViewGrid.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Modules\Main\View\ViewerMainViewGrid.xaml.cs">
|
||||
<DependentUpon>ViewerMainViewGrid.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Modules\Main\View\ViewerMainView.xaml.cs">
|
||||
<DependentUpon>ViewerMainView.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Resources\StringResources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>StringResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Resources\TranslateExtension.cs" />
|
||||
<Compile Include="Settings.cs" />
|
||||
<Compile Include="ViewerModule.cs" />
|
||||
<Page Include="Modules\Main\View\ExportMainView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Modules\Main\View\ExportMainViewGrid.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Modules\Main\View\ViewerMainViewGrid.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Modules\Main\View\ViewerMainView.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Include="Themes\Default.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\Settings.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DependentUpon>Settings.settings</DependentUpon>
|
||||
<DesignTimeSharedInput>True</DesignTimeSharedInput>
|
||||
</Compile>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\StringResources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>StringResources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="DTS.Viewer.gclicx" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
</None>
|
||||
<AppDesigner Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="App.config">
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\Common\DTS.Common.Core\DTS.Common.Core.csproj">
|
||||
<Project>{fab1f470-1574-4301-b56e-d3364aa93679}</Project>
|
||||
<Name>DTS.Common.Core</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Common\DTS.Common.SettingsDB\DTS.Common.Settings.csproj">
|
||||
<Project>{61017104-D8EE-41D1-B9CA-DAD863FF78B2}</Project>
|
||||
<Name>DTS.Common.Settings</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Common\DTS.Common.Utilities\DTS.Common.Utilities.csproj">
|
||||
<Project>{d6da1b74-c711-43c2-91b1-1908a8d04dbf}</Project>
|
||||
<Name>DTS.Common.Utilities</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\..\Common\DTS.Common\DTS.Common.csproj">
|
||||
<Project>{114edc77-f3b5-4576-a91b-40818d503b55}</Project>
|
||||
<Name>DTS.Common</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PostBuildEvent>
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,54 @@
|
||||
using System.Collections.Specialized;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using Microsoft.Practices.Prism.Regions;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
public class StackPanelRegionAdapter : RegionAdapterBase<StackPanel>
|
||||
{
|
||||
|
||||
public StackPanelRegionAdapter(IRegionBehaviorFactory regionBehaviorFactory)
|
||||
: base(regionBehaviorFactory)
|
||||
{
|
||||
}
|
||||
|
||||
protected override void Adapt(IRegion region, StackPanel regionTarget)
|
||||
{
|
||||
if (region == null) return;
|
||||
|
||||
region.Views.CollectionChanged += (sender, e) =>
|
||||
{
|
||||
switch (e.Action)
|
||||
{
|
||||
case NotifyCollectionChangedAction.Add:
|
||||
|
||||
foreach (UIElement element in e.NewItems)
|
||||
{
|
||||
regionTarget.Children.Add(element);
|
||||
}
|
||||
break;
|
||||
|
||||
case NotifyCollectionChangedAction.Remove:
|
||||
|
||||
foreach (UIElement elementLoopVariable in e.OldItems)
|
||||
{
|
||||
var element = elementLoopVariable;
|
||||
|
||||
if (regionTarget.Children.Contains(element))
|
||||
{
|
||||
regionTarget.Children.Remove(element);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
protected override IRegion CreateRegion()
|
||||
{
|
||||
return new AllActiveRegion();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
<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: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"
|
||||
xmlns:toolkit="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:dock="http://schemas.xceed.com/wpf/xaml/avalondock">
|
||||
|
||||
<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="MainRegion" prism:RegionManager.RegionName="{x:Static classes:RegionNames.MainRegion}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">-->
|
||||
<!--<dock:DockingManager AllowMixedOrientation="True" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
|
||||
MinHeight="500" MinWidth="1000" BorderBrush="Black" BorderThickness="1">
|
||||
<dock:LayoutRoot x:Name="_layoutRoot">
|
||||
<dock:LayoutRoot.LeftSide>
|
||||
<dock:LayoutAnchorSide>
|
||||
<dock:LayoutAnchorGroup>
|
||||
<dock:LayoutAnchorable>
|
||||
<TextBlock Text="Navigation" Margin="10" FontSize="18" FontWeight="Black" TextWrapping="Wrap"/>
|
||||
|
||||
</dock:LayoutAnchorable>
|
||||
</dock:LayoutAnchorGroup>
|
||||
</dock:LayoutAnchorSide>
|
||||
</dock:LayoutRoot.LeftSide>
|
||||
<dock:LayoutRoot.BottomSide>
|
||||
<dock:LayoutAnchorSide>
|
||||
<dock:LayoutAnchorGroup>
|
||||
<dock:LayoutAnchorable>
|
||||
<TextBlock Text="Channels" Margin="10" FontSize="18" FontWeight="Black" TextWrapping="Wrap"/>
|
||||
</dock:LayoutAnchorable>
|
||||
</dock:LayoutAnchorGroup>
|
||||
</dock:LayoutAnchorSide>
|
||||
</dock:LayoutRoot.BottomSide>
|
||||
<dock:LayoutRoot.RightSide>
|
||||
<dock:LayoutAnchorSide>
|
||||
<dock:LayoutAnchorGroup>
|
||||
<dock:LayoutAnchorable>
|
||||
<TextBlock Text="Properties" Margin="10" FontSize="18" FontWeight="Black" TextWrapping="Wrap"/>
|
||||
</dock:LayoutAnchorable>
|
||||
</dock:LayoutAnchorGroup>
|
||||
</dock:LayoutAnchorSide>
|
||||
</dock:LayoutRoot.RightSide>
|
||||
</dock:LayoutRoot>
|
||||
</dock:DockingManager>-->
|
||||
|
||||
<!--<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 Orientation="Vertical">
|
||||
<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>
|
||||
<!--</ContentControl>-->
|
||||
</StackPanel>
|
||||
</base:BaseView>
|
||||
@@ -0,0 +1,188 @@
|
||||
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.Viewer.View;
|
||||
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 ShellViewModel : 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 ShellViewModel(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(((ShellView)View).MainShell, "Region", ref items);
|
||||
return items;
|
||||
}
|
||||
|
||||
public Object ContextMainRegion
|
||||
{
|
||||
get { return ((ShellView)View).MainRegion.Content; }
|
||||
set { ((ShellView)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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,107 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using DTS.Common.Events;
|
||||
using DTS.Common.Core.PluginLib;
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
using Microsoft.Practices.Prism.Modularity;
|
||||
using Microsoft.Practices.Prism.Regions;
|
||||
using Microsoft.Practices.ServiceLocation;
|
||||
using Microsoft.Practices.Unity;
|
||||
// ReSharper disable EmptyConstructor
|
||||
|
||||
// ReSharper disable InconsistentNaming
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
/// <summary>
|
||||
/// I think we need it...
|
||||
/// </summary>
|
||||
public class ViewerSession
|
||||
{
|
||||
/// <summary>
|
||||
/// Custom Bootstrapper
|
||||
/// </summary>
|
||||
///<remarks>
|
||||
/// Do not try to re-create the bootstrapper. Once modules are loaded, they will be be loaded into the DirectoryModuleCatalog and each
|
||||
/// Module initialization will not be called (thus no registered types).
|
||||
/// It appears that the current bootstrapper loads around 40 MB into memory.
|
||||
/// To completely unload the bootstrapper would take same research and effort.
|
||||
/// </remarks>
|
||||
private Bootstrapper _bootstrapper;
|
||||
|
||||
public IUnityContainer Container { get; private set; }
|
||||
public IServiceLocator _serviceLocator { get; private set; }
|
||||
public IEventAggregator _eventAggregator { get; private set; }
|
||||
public IRegionManager _regionManager { get; private set; }
|
||||
private string _customConfigPath = string.Empty;
|
||||
public string CustomConfigPath { get => _customConfigPath; set => _customConfigPath = value; }
|
||||
/// <summary>
|
||||
/// empty constructor
|
||||
/// </summary>
|
||||
public ViewerSession()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public void CreateSession(bool standalone, string customConfigPath = "")
|
||||
{
|
||||
CustomConfigPath = customConfigPath;
|
||||
CreateBootstrapper(standalone, customConfigPath);
|
||||
if (_bootstrapper == null) return;
|
||||
Container = _bootstrapper.Container;
|
||||
_eventAggregator = Container.Resolve<IEventAggregator>();
|
||||
_serviceLocator = Container.Resolve<IServiceLocator>();
|
||||
_regionManager = Container.Resolve<IRegionManager>();
|
||||
//TODO: review publishPlugins vs base.InitializeModules();
|
||||
publishPlugins(_eventAggregator, LoadPlugins());
|
||||
}
|
||||
|
||||
private List<Assembly> LoadPlugins()
|
||||
{
|
||||
var pluginManager = PluginManager.GetPluginManager(CustomConfigPath);
|
||||
return pluginManager.GetPluginList<IModule>();
|
||||
}
|
||||
|
||||
private void publishPlugins(IEventAggregator eventAggregator, List<Assembly> pluginList)
|
||||
{
|
||||
eventAggregator.GetEvent<AssemblyListNotificationViewer>().Publish(new AssemblyListInfo(pluginList));
|
||||
}
|
||||
/// <summary>
|
||||
/// Create bootstrapper for prism-based modules and views.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Currently, there is no course of action for destroying the bootstrapper.
|
||||
/// </remarks>
|
||||
private void CreateBootstrapper(bool standalone, string customConfigPath = "")
|
||||
{
|
||||
if (_bootstrapper == null)
|
||||
{
|
||||
try
|
||||
{
|
||||
_bootstrapper = new Bootstrapper(standalone, customConfigPath);
|
||||
_bootstrapper.Run();
|
||||
}
|
||||
catch (ApplicationException ex)
|
||||
{
|
||||
throw new Exception("Failed to create bootstrapper ", ex);
|
||||
}
|
||||
}
|
||||
|
||||
if (_bootstrapper == null)
|
||||
{
|
||||
throw new Exception("Failed to create Bootstrapper!");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The Terminate method is called only when JMPS is in the process of shutting down.
|
||||
/// If a component is just being closed, only the class destructor will be called.
|
||||
/// Part of IComponent implementation.
|
||||
/// </summary>
|
||||
public void Terminate()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.ComponentModel.Composition;
|
||||
using DTS.Common.Events;
|
||||
using DTS.Common.Interface;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using Prism.Modularity;
|
||||
using Unity;
|
||||
using Unity.Lifetime;
|
||||
|
||||
// ReSharper disable NotAccessedField.Local
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable ConvertToAutoProperty
|
||||
// ReSharper disable RedundantDefaultMemberInitializer
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
[Export(typeof(IModule))]
|
||||
[Module(ModuleName = "Viewer")]
|
||||
public class ViewerModule : IViewerModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Injected unity container
|
||||
/// </summary>
|
||||
private readonly IUnityContainer _unityContainer;
|
||||
public bool SessionStarted { get; private set; }
|
||||
|
||||
public ViewerModule(IUnityContainer unityContainer)
|
||||
{
|
||||
_unityContainer = unityContainer;
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_unityContainer.RegisterType<IViewerModule, ViewerModule>(new ContainerControlledLifetimeManager());
|
||||
}
|
||||
|
||||
public void StartSession()
|
||||
{
|
||||
var eventAggregator = _unityContainer.Resolve<IEventAggregator>();
|
||||
eventAggregator?.GetEvent<LoadViewModulEvent>().Publish(new LoadViewModulArg());
|
||||
SessionStarted = true;
|
||||
}
|
||||
|
||||
public void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void OnInitialized(IContainerProvider containerProvider)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Attribute class contains assembly name
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
|
||||
public class ViewerNameAttribute : TextAttribute
|
||||
{
|
||||
private readonly string _assemblyName;
|
||||
public ViewerNameAttribute() : this(null) { }
|
||||
|
||||
public ViewerNameAttribute(string s)
|
||||
{
|
||||
_assemblyName = "Viewer";
|
||||
}
|
||||
|
||||
public override string AssemblyName => _assemblyName;
|
||||
|
||||
public override Type GetAttributeType()
|
||||
{
|
||||
return typeof(TextAttribute);
|
||||
}
|
||||
|
||||
public override string GetAssemblyName()
|
||||
{
|
||||
return AssemblyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DTS.Viewer.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.10.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Windows.Markup;
|
||||
using DTS.Viewer.Resources;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
[MarkupExtensionReturnType(typeof(string))]
|
||||
public class TranslateExtension : MarkupExtension
|
||||
{
|
||||
private readonly string _key;
|
||||
public TranslateExtension(string key) { _key = key; }
|
||||
|
||||
private const string NotFound = "#stringnotfound#";
|
||||
|
||||
public override object ProvideValue(IServiceProvider serviceProvider)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_key)) { return NotFound; }
|
||||
return StringResources.ResourceManager.GetString(_key) ?? NotFound + " " + _key;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using DTS.Common.Events;
|
||||
using DTS.Common.Interface;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using Prism.Modularity;
|
||||
using Unity;
|
||||
using Unity.Lifetime;
|
||||
|
||||
// ReSharper disable NotAccessedField.Local
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable ConvertToAutoProperty
|
||||
// ReSharper disable RedundantDefaultMemberInitializer
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
[Module(ModuleName = "Export")]
|
||||
public class ExportModule : IExportModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Injected unity container
|
||||
/// </summary>
|
||||
private readonly IUnityContainer _unityContainer;
|
||||
public bool SessionStarted { get; private set; }
|
||||
public ExportModule(IUnityContainer unityContainer)
|
||||
{
|
||||
|
||||
_unityContainer = unityContainer;
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_unityContainer.RegisterType<IExportModule, ExportModule>(new ContainerControlledLifetimeManager());
|
||||
}
|
||||
|
||||
public void StartSession()
|
||||
{
|
||||
var eventAggregator = _unityContainer.Resolve<IEventAggregator>();
|
||||
eventAggregator?.GetEvent<LoadExportModuleEvent>().Publish(new LoadExportModuleArg());
|
||||
SessionStarted = true;
|
||||
}
|
||||
|
||||
public void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void OnInitialized(IContainerProvider containerProvider)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Attribute class contains assembly name
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
|
||||
public class ExportNameAttribute : TextAttribute
|
||||
{
|
||||
private readonly string _assemblyName;
|
||||
public ExportNameAttribute() : this(null) { }
|
||||
|
||||
public ExportNameAttribute(string s)
|
||||
{
|
||||
_assemblyName = "Export";
|
||||
}
|
||||
|
||||
public override string AssemblyName => _assemblyName;
|
||||
|
||||
public override Type GetAttributeType()
|
||||
{
|
||||
return typeof(TextAttribute);
|
||||
}
|
||||
|
||||
public override string GetAssemblyName()
|
||||
{
|
||||
return AssemblyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
@@ -0,0 +1,15 @@
|
||||
using DTS.Common.Interface;
|
||||
|
||||
namespace DTS.Viewer.View
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for ShellView.xaml
|
||||
/// </summary>
|
||||
public partial class ShellView : IViewerShellView
|
||||
{
|
||||
public ShellView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<section name="DTS.Common.Core.PluginLib.Config" type="DTS.Common.Core.PluginLib.PluginConfigSectionHandler, DTS.Common.Core"/>
|
||||
</configSections>
|
||||
|
||||
<!--<DTS.Common.Core.PluginLib.Config>
|
||||
<PluginFolders>
|
||||
<add key="viewerPlugins" value="..//..//..//..//RunTimeModules"/>
|
||||
</PluginFolders>
|
||||
</DTS.Common.Core.PluginLib.Config>-->
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/>
|
||||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Windows.Interactivity" publicKeyToken="31bf3856ad364e35" culture="neutral"/>
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0"/>
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
||||
@@ -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="<<">
|
||||
<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="<<" />
|
||||
</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=">>" />
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,210 @@
|
||||
using System.ComponentModel;
|
||||
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.Prism.Regions;
|
||||
using Microsoft.Practices.Unity;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
public class MainViewModel : BaseViewModel<IMainViewModel>, IMainViewModel
|
||||
{
|
||||
public IMainView View { get; private set; }
|
||||
private IViewerShellViewModel Parent { get; 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 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);
|
||||
|
||||
|
||||
_unityContainer.RegisterType<IMenuView, MenuView>();
|
||||
_unityContainer.RegisterType<IMenuViewModel, MenuViewModel>();
|
||||
|
||||
_unityContainer.RegisterType<INavigationView, NavigationView>();
|
||||
_unityContainer.RegisterType<INavigationViewModel, NavigationViewModel>();
|
||||
}
|
||||
|
||||
#region Methods
|
||||
/// <summary>
|
||||
/// Initialize without parameter
|
||||
/// </summary>
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initialize with parameter - Parent
|
||||
/// </summary>
|
||||
public override void Initialize(object parameter)
|
||||
{
|
||||
Parent = (IViewerShellViewModel)parameter;
|
||||
Parent.IsMenuIncluded = _isMenuIncluded;
|
||||
Parent.IsNavigationIncluded = _isNavigationIncluded;
|
||||
_eventAggregator.GetEvent<AssemblyListNotification>().Subscribe(OnAssemblyListChange, 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 groupListView = _unityContainer.Resolve<IGroupListView>();
|
||||
//var groupListViewModel = _unityContainer.Resolve<IGroupListViewModel>();
|
||||
|
||||
//var asmImage = new List<AssemblyNameImage>();
|
||||
//foreach (var assembly in e.AssemblyList)
|
||||
//{
|
||||
// asmImage.AddRange(from attribute in assembly.GetCustomAttributes()
|
||||
// where attribute.GetType().Name.EndsWith("ImageAttribute")
|
||||
// select new AssemblyNameImage
|
||||
// {
|
||||
// AssemblyGroup = ((ImageAttribute)attribute).GeAssemblyGroup(),
|
||||
// AssemblyName = Regex.Replace(((ImageAttribute)attribute).GeAssemblyName(), "(\\B[A-Z])", " $1"),
|
||||
// AssemblyImage = ((ImageAttribute)attribute).GeAssemblyImage(),
|
||||
|
||||
// });
|
||||
//}
|
||||
//var asmGroups = new List<AssemblyGroups>();
|
||||
//asmGroups.AddRange(from a in asmImage orderby a.SortOrder group a by a.AssemblyGroup into g select new AssemblyGroups { AssemblyGroupName = g.Key, AssemblyList = new List<AssemblyNameImage>(g.ToList()) });
|
||||
|
||||
//foreach (var group in asmGroups)
|
||||
//{
|
||||
// var groupView = new GroupView();
|
||||
// var groupViewModel = new GroupViewModel(groupView, _regionManager, _eventAggregator, _unityContainer)
|
||||
// {
|
||||
// GroupName = @group.AssemblyGroupName,
|
||||
// AssemblyList = @group.AssemblyList
|
||||
// };
|
||||
// groupViewModel.Initialize(groupListViewModel);
|
||||
// groupView.DataContext = groupViewModel;
|
||||
|
||||
// groupListViewModel.GroupList.Add(groupView);
|
||||
//}
|
||||
|
||||
//groupListViewModel.View = groupListView;
|
||||
//groupListViewModel.Initialize(this);
|
||||
//groupListView.DataContext = groupListViewModel;
|
||||
//ContextMainRegion = groupListView;
|
||||
}
|
||||
|
||||
/// <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
|
||||
});
|
||||
}
|
||||
|
||||
///<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));
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region ContextRegion
|
||||
public object ContextMainRegion
|
||||
{
|
||||
get
|
||||
{
|
||||
return null; /* ((MainView)View).MainRegion.Content; */ }
|
||||
set
|
||||
{
|
||||
//((MainView)View).MainRegion.Content = value;
|
||||
//var viewModel = (IBaseViewModel)((IBaseView)value).DataContext;
|
||||
//Parent.IsMenuIncluded = viewModel.IsMenuIncluded;
|
||||
//Parent.IsNavigationIncluded = viewModel.IsNavigationIncluded;
|
||||
OnPropertyChanged("ContextMainRegion");
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
//List<IGroupView> _assemblyGroupList = new List<IGroupView>();
|
||||
//public List<IGroupView> AssemblyGroupList
|
||||
//{
|
||||
// get { return _assemblyGroupList; }
|
||||
// set { _assemblyGroupList = value; OnPropertyChanged("AssemblyGroupList"); }
|
||||
//}
|
||||
|
||||
|
||||
|
||||
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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DTS.Viewer.Properties {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class Resources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal Resources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DTS.Viewer.Properties.Resources", typeof(Resources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Interface;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for DockPanelHorizontal.xaml
|
||||
/// </summary>
|
||||
public partial class DockPanelHorizontalView : IDockPanelHorizontalView
|
||||
{
|
||||
public DockPanelHorizontalView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
331cf6cd-b73c-429f-ba79-fa2f85eebd68;-8585372584854775808;RFRTLlZpZXdlci5kbGw=;MzMxY2Y2Y2QtYjczYy00MjlmLWJhNzktZmEyZjg1ZWViZDY4,MzQzMjc1NzdYWFhYWFhYWDA4NA,SkVSUlktUDUzUw,RmFsc2U,NzcyOA,RmFsc2U,MA,MA,djIwMjEuMQ,,;UWAeDwzbfcGAOjyGDUe5049rTeG3ipUDqwcHwAOIDz22UvSZSDQBtSMzX2O5TQ/kHa70PL/8/Gm2WhH7XG63CGkdWQUtUrS8DhxdSJj/K1Zbqazy4stesUvx+sI+uasR/oGMR9nT9bJ20bmKWLfRE6TgNUyFJ4Y2ViJoaHPLE2U
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<ProjectView>ProjectFiles</ProjectView>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,32 @@
|
||||
<base:BaseView x:Class="DTS.Viewer.TabView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
|
||||
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
|
||||
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
|
||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
||||
xmlns:xcad="http://schemas.xceed.com/wpf/xaml/avalondock"
|
||||
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism">
|
||||
<base:BaseView.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Themes/Default.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</base:BaseView.Resources>
|
||||
|
||||
<xcad:DockingManager></xcad:DockingManager>
|
||||
|
||||
|
||||
<!--<ContentControl x:Name="TabRegion" Background="LightGray">
|
||||
<ContentControl.Template>
|
||||
<ControlTemplate TargetType="ContentControl">
|
||||
<Grid>
|
||||
<ContentPresenter Content="{TemplateBinding Content}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</ContentControl.Template>
|
||||
</ContentControl>-->
|
||||
</base:BaseView>
|
||||
@@ -0,0 +1,15 @@
|
||||
using DTS.Common.Interface;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MenuView.xaml
|
||||
/// </summary>
|
||||
public partial class MenuView : IMenuView
|
||||
{
|
||||
public MenuView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.ComponentModel.Composition.Hosting;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using DTS.Common;
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Core.PluginLib;
|
||||
using DTS.Common.Interface;
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
using Microsoft.Practices.Prism.Modularity;
|
||||
using Microsoft.Practices.Prism.Regions;
|
||||
using Microsoft.Practices.Prism.UnityExtensions;
|
||||
using Microsoft.Practices.ServiceLocation;
|
||||
using Microsoft.Practices.Unity;
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable ConvertToAutoProperty
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
/// <summary>
|
||||
/// https://msdn.microsoft.com/en-us/library/ff921075(v=pandp.20).aspx
|
||||
/// </summary>
|
||||
public class Bootstrapper : UnityBootstrapper
|
||||
{
|
||||
private IRegionManager _regionManager;
|
||||
private IUnityContainer _unityContainer => Container;
|
||||
public IServiceLocator _ServiceLocator { get; private set; }
|
||||
public IEventAggregator _EventAggregator { get; private set; }
|
||||
|
||||
private bool _standalone;
|
||||
public bool Standalone
|
||||
{
|
||||
get => _standalone;
|
||||
set => _standalone = value;
|
||||
}
|
||||
private string _customConfigPath = string.Empty;
|
||||
public string CustomConfigPath { get => _customConfigPath; set => _customConfigPath = value; }
|
||||
|
||||
|
||||
public Bootstrapper(bool standalone, string customConfigPath = "")
|
||||
{
|
||||
_customConfigPath = customConfigPath;
|
||||
_standalone = standalone;
|
||||
}
|
||||
|
||||
protected override void ConfigureContainer()
|
||||
{
|
||||
Container = ServiceLocator.Current.GetInstance<IUnityContainer>();
|
||||
|
||||
//if (Standalone)
|
||||
//{ _unityContainer.RegisterType<IViewerMainView, ViewerMainView>(); _unityContainer.RegisterType<IViewerMainViewModel, ViewerMainViewModel>(new ContainerControlledLifetimeManager()); }
|
||||
//else
|
||||
//{ _unityContainer.RegisterType<IViewerMainViewGrid, ViewerMainViewGrid>(); _unityContainer.RegisterType<IViewerMainViewModel, ViewerMainViewModel>(new ContainerControlledLifetimeManager()); }
|
||||
|
||||
//_unityContainer.RegisterType<IViewerMainView, ViewerMainView>();
|
||||
_unityContainer.RegisterType<IViewerMainViewGrid, ViewerMainViewGrid>();
|
||||
_unityContainer.RegisterType<IViewerMainViewModel, ViewerMainViewModel>(new ContainerControlledLifetimeManager());
|
||||
|
||||
base.ConfigureContainer();
|
||||
}
|
||||
protected override RegionAdapterMappings ConfigureRegionAdapterMappings()
|
||||
{
|
||||
//var regionAdapterMappings = base.ConfigureRegionAdapterMappings();
|
||||
//re-implement base CRAM. doesn't catch already registered mappings
|
||||
//https://prismlibrary.com/docs/wpf/legacy/Appendix-D-Extending-Prism.html#customizing-the-region-adapter-mappings
|
||||
RegionAdapterMappings regionAdapterMappings = ServiceLocator.Current.GetInstance<RegionAdapterMappings>();
|
||||
if (regionAdapterMappings != null)
|
||||
{
|
||||
try { regionAdapterMappings.RegisterMapping(typeof(System.Windows.Controls.Primitives.Selector), ServiceLocator.Current.GetInstance<SelectorRegionAdapter>()); } catch { }
|
||||
try { regionAdapterMappings.RegisterMapping(typeof(ItemsControl), ServiceLocator.Current.GetInstance<ItemsControlRegionAdapter>()); } catch { }
|
||||
try { regionAdapterMappings.RegisterMapping(typeof(ContentControl), ServiceLocator.Current.GetInstance<ContentControlRegionAdapter>()); } catch { }
|
||||
}
|
||||
|
||||
if (Standalone) { try { regionAdapterMappings.RegisterMapping(typeof(StackPanel), ServiceLocator.Current.GetInstance<StackPanelRegionAdapter>()); } catch { } }
|
||||
return regionAdapterMappings;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The CreateShell method allows a developer to specify the top-level window for a Prism application.
|
||||
/// The shell is usually the MainWindow or MainPage. Implement this method by returning an instance of
|
||||
/// your application's shell class. In a Prism application, you can create the shell object, or resolve
|
||||
/// it from the container, depending on your application's requirements.
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
protected override DependencyObject CreateShell()
|
||||
{
|
||||
try
|
||||
{
|
||||
Container = ServiceLocator.Current.GetInstance<IUnityContainer>();
|
||||
_EventAggregator = Container.Resolve<IEventAggregator>();
|
||||
_ServiceLocator = Container.Resolve<IServiceLocator>();
|
||||
|
||||
var viewModel = _unityContainer.TryResolve<IViewerMainViewModel>();
|
||||
|
||||
if (viewModel == null) return new DependencyObject();
|
||||
|
||||
var view = viewModel.View;
|
||||
|
||||
// Registering region
|
||||
if (!Container.IsRegistered<IRegionManager>()) return ServiceLocator.Current.GetInstance<ViewerMainView>();
|
||||
|
||||
_regionManager = Container.Resolve<IRegionManager>();
|
||||
foreach (var region in viewModel.GetRegions())
|
||||
{
|
||||
if (_regionManager.Regions.ContainsRegionWithName(region.Name)) continue;
|
||||
_regionManager.Regions.Add(new Region { Name = region.Name, Context = region });
|
||||
RegionManager.SetRegionManager(region, _regionManager);
|
||||
RegionManager.UpdateRegions();
|
||||
}
|
||||
|
||||
view.DataContext = viewModel;
|
||||
//((ViewerMainView)view).Visibility = Visibility.Visible;
|
||||
if (Standalone)
|
||||
{
|
||||
var parent = _unityContainer.Resolve<IShellViewModel>();
|
||||
viewModel.Initialize(parent);
|
||||
parent.ContextMainRegion = view;
|
||||
}
|
||||
else
|
||||
{
|
||||
viewModel.Initialize();
|
||||
}
|
||||
return (DependencyObject)view; //ServiceLocator.Current.GetInstance<MainView>();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
var s = e.Message;
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns the module catalog that will be used to initialize the modules.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// An instance of <see cref="IModuleCatalog"/> that will be used to initialize the modules.
|
||||
/// </returns>
|
||||
protected override IModuleCatalog CreateModuleCatalog()
|
||||
{
|
||||
// The module catalog is used by the ModuleManager and ModuleLoader components, which are responsible for downloading the modules.
|
||||
if (Container == null) Container = ServiceLocator.Current.GetInstance<IUnityContainer>();
|
||||
var catalog = Container.TryResolve<IModuleCatalog>();
|
||||
return catalog ?? new AggregateModuleCatalog();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modules are packages of functionality that can be independently developed, tested, and (optionally) deployed.
|
||||
/// In a composite application, modules must be discovered and loaded at run time by the host application.
|
||||
/// The module catalog is used by the ModuleManager and ModuleLoader components, which are responsible for downloading the modules.
|
||||
/// Modules are copied to a directory as part of a post-build step. These modules are not referenced in the project and are discovered by inspecting a directory.
|
||||
/// Module projects have a post-build step to copy themselves into that directory.
|
||||
/// </summary>
|
||||
protected override void ConfigureModuleCatalog()
|
||||
{
|
||||
var pluginFolders = string.Empty;
|
||||
|
||||
if (!Standalone) return;
|
||||
var applicationSettings = ConfigurationManager.GetSection("DTS.Common.Core.PluginLib.Config");
|
||||
foreach (FilterHashElement key in ((PluginConfigSectionHandler)applicationSettings).HashKeys) { if (key.Key != "viewerPlugins") continue; pluginFolders = key.Value; break; }
|
||||
if (string.IsNullOrEmpty(pluginFolders)) return;
|
||||
var directoryCatalog = new DirectoryModuleCatalog { ModulePath = pluginFolders };
|
||||
((AggregateModuleCatalog)ModuleCatalog).AddCatalog(directoryCatalog);
|
||||
}
|
||||
protected override void InitializeModules()
|
||||
{
|
||||
if (!Standalone) return;
|
||||
// Register the DTSRegionManager with Unity dependency injection container as a singleton.
|
||||
Container.RegisterType<IDTSViewRegionManager, DTSViewRegionManager>(new ContainerControlledLifetimeManager(), new InjectionMember[] { });
|
||||
base.InitializeModules();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
using System.Reflection;
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("DTS.Viewer")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("Diversified Technical Systems, Inc. (DTS)")]
|
||||
[assembly: AssemblyProduct("DTS.Viewer")]
|
||||
[assembly: AssemblyCopyright("Copyright © Microsoft 2016")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
//In order to begin building localizable applications, set
|
||||
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
|
||||
//inside a <PropertyGroup>. For example, if you are using US english
|
||||
//in your source files, set the <UICulture> to en-US. Then uncomment
|
||||
//the NeutralResourceLanguage attribute below. Update the "en-US" in
|
||||
//the line below to match the UICulture setting in the project file.
|
||||
|
||||
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
|
||||
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using DTS.Common.Base;
|
||||
using DTS.Common.Interface;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for DockPanelVerticalView.xaml
|
||||
/// </summary>
|
||||
public partial class DockPanelVerticalView : IDockPanelVerticalView
|
||||
{
|
||||
public DockPanelVerticalView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,106 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
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.Prism.Regions;
|
||||
using Microsoft.Practices.Unity;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
public class DockPanelVerticalViewModel : BaseViewModel<IDockPanelVerticalViewModel>, IDockPanelVerticalViewModel
|
||||
{
|
||||
public IDockPanelVerticalView View { get; private set; }
|
||||
private IViewModel 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 InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
|
||||
|
||||
public DockPanelVerticalViewModel(IDockPanelVerticalView 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 Properties
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
public bool IsMenuIncluded { get; set; }
|
||||
public bool IsNavigationIncluded { get; set; }
|
||||
public bool IsBusy { get; set; }
|
||||
public bool IsDirty { get; private set; }
|
||||
|
||||
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <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 });
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Initialize(object parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Activated()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override void Cleanup()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public new Task CleanupAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public new void Initialize(object parameter, object model)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task InitializeAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task InitializeAsync(object parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion Methods
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
using System;
|
||||
using System.ComponentModel.Composition;
|
||||
using DTS.Common.Events;
|
||||
using DTS.Common.Interface;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using Prism.Modularity;
|
||||
using Unity;
|
||||
using Unity.Lifetime;
|
||||
|
||||
// ReSharper disable NotAccessedField.Local
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable ConvertToAutoProperty
|
||||
// ReSharper disable RedundantDefaultMemberInitializer
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
[Export(typeof(IModule))]
|
||||
[Module(ModuleName = "Export")]
|
||||
public class ExportModule : IExportModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Injected unity container
|
||||
/// </summary>
|
||||
private readonly IUnityContainer _unityContainer;
|
||||
public bool SessionStarted { get; private set; }
|
||||
public ExportModule(IUnityContainer unityContainer)
|
||||
{
|
||||
|
||||
_unityContainer = unityContainer;
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_unityContainer.RegisterType<IExportModule, ExportModule>(new ContainerControlledLifetimeManager());
|
||||
}
|
||||
|
||||
public void StartSession()
|
||||
{
|
||||
var eventAggregator = _unityContainer.Resolve<IEventAggregator>();
|
||||
eventAggregator?.GetEvent<LoadExportModuleEvent>().Publish(new LoadExportModuleArg());
|
||||
SessionStarted = true;
|
||||
}
|
||||
|
||||
public void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void OnInitialized(IContainerProvider containerProvider)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Attribute class contains assembly name
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
|
||||
public class ExportNameAttribute : TextAttribute
|
||||
{
|
||||
private readonly string _assemblyName;
|
||||
public ExportNameAttribute() : this(null) { }
|
||||
|
||||
public ExportNameAttribute(string s)
|
||||
{
|
||||
_assemblyName = "Export";
|
||||
}
|
||||
|
||||
public override string AssemblyName => _assemblyName;
|
||||
|
||||
public override Type GetAttributeType()
|
||||
{
|
||||
return typeof(TextAttribute);
|
||||
}
|
||||
|
||||
public override string GetAssemblyName()
|
||||
{
|
||||
return AssemblyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
using System;
|
||||
using DTS.Common.Events;
|
||||
using DTS.Common.Interface;
|
||||
using Prism.Events;
|
||||
using Prism.Ioc;
|
||||
using Prism.Modularity;
|
||||
using Unity;
|
||||
using Unity.Lifetime;
|
||||
|
||||
// ReSharper disable NotAccessedField.Local
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable ConvertToAutoProperty
|
||||
// ReSharper disable RedundantDefaultMemberInitializer
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
[Module(ModuleName = "Viewer")]
|
||||
public class ViewerModule : IViewerModule
|
||||
{
|
||||
/// <summary>
|
||||
/// Injected unity container
|
||||
/// </summary>
|
||||
private readonly IUnityContainer _unityContainer;
|
||||
public bool SessionStarted { get; private set; }
|
||||
|
||||
public ViewerModule(IUnityContainer unityContainer)
|
||||
{
|
||||
_unityContainer = unityContainer;
|
||||
}
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
_unityContainer.RegisterType<IViewerModule, ViewerModule>(new ContainerControlledLifetimeManager());
|
||||
}
|
||||
|
||||
public void StartSession()
|
||||
{
|
||||
var eventAggregator = _unityContainer.Resolve<IEventAggregator>();
|
||||
eventAggregator?.GetEvent<LoadViewModulEvent>().Publish(new LoadViewModulArg());
|
||||
SessionStarted = true;
|
||||
}
|
||||
|
||||
public void RegisterTypes(IContainerRegistry containerRegistry)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
public void OnInitialized(IContainerProvider containerProvider)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Attribute class contains assembly name
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = false)]
|
||||
public class ViewerNameAttribute : TextAttribute
|
||||
{
|
||||
private readonly string _assemblyName;
|
||||
public ViewerNameAttribute() : this(null) { }
|
||||
|
||||
public ViewerNameAttribute(string s)
|
||||
{
|
||||
_assemblyName = "Viewer";
|
||||
}
|
||||
|
||||
public override string AssemblyName => _assemblyName;
|
||||
|
||||
public override Type GetAttributeType()
|
||||
{
|
||||
return typeof(TextAttribute);
|
||||
}
|
||||
|
||||
public override string GetAssemblyName()
|
||||
{
|
||||
return AssemblyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
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<IViewerMainView, ViewerMainView>();
|
||||
_unityContainer.RegisterType<IViewerMainViewModel, ViewerMainViewModel>(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)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
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 => ((ViewerShellView)View).MainRegion.Content;
|
||||
set { ((ViewerShellView)View).MainRegion.Content = value; OnPropertyChanged("ContextMainRegion"); }
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
private bool _isMenuIncluded = false;
|
||||
public bool IsMenuIncluded
|
||||
{
|
||||
get => _isMenuIncluded;
|
||||
set
|
||||
{
|
||||
_isMenuIncluded = value;
|
||||
OnPropertyChanged("IsMenuIncluded");
|
||||
}
|
||||
}
|
||||
private bool _isNavigationIncluded = false;
|
||||
public bool IsNavigationIncluded
|
||||
{
|
||||
get => _isNavigationIncluded;
|
||||
set
|
||||
{
|
||||
_isNavigationIncluded = value;
|
||||
OnPropertyChanged("IsNavigationIncluded");
|
||||
}
|
||||
}
|
||||
|
||||
private bool _isBusy;
|
||||
public bool IsBusy
|
||||
{
|
||||
get => _isBusy;
|
||||
set { _isBusy = value; OnPropertyChanged("IsBusy"); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Gets the HeaderInfo.
|
||||
/// </summary>
|
||||
public string HeaderInfo { get { return "MainRegion"; } }
|
||||
#endregion Properties
|
||||
|
||||
///<summary>
|
||||
///Occurs when a property value changes.
|
||||
///</summary>
|
||||
public new event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
private void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
void IBasePropertyChanged.OnPropertyChanged(string propertyName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
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.Prism.Regions;
|
||||
using Microsoft.Practices.Unity;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
public class DockPanelHorizontalViewModel : BaseViewModel<IDockPanelHorizontalViewModel>, IDockPanelHorizontalViewModel
|
||||
{
|
||||
public IDockPanelHorizontalView View { get; private set; }
|
||||
private IViewModel 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 InteractionRequest<Confirmation> ConfirmationRequest { get; private set; }
|
||||
|
||||
#region Properties
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
public bool IsMenuIncluded { get; set; }
|
||||
public bool IsNavigationIncluded { get; set; }
|
||||
public bool IsBusy { get; set; }
|
||||
public bool IsDirty { get; private set; }
|
||||
|
||||
public DockPanelHorizontalViewModel(IDockPanelHorizontalView 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);
|
||||
}
|
||||
#endregion Properties
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <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 });
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Initialize(object parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override void Activated()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
public override void Cleanup()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public new Task CleanupAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public new void Initialize(object parameter, object model)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task InitializeAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task InitializeAsync(object parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
#endregion Methods
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
// Runtime Version:4.0.30319.42000
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace DTS.Viewer.Resources {
|
||||
using System;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// A strongly-typed resource class, for looking up localized strings, etc.
|
||||
/// </summary>
|
||||
// This class was auto-generated by the StronglyTypedResourceBuilder
|
||||
// class via a tool like ResGen or Visual Studio.
|
||||
// To add or remove a member, edit your .ResX file then rerun ResGen
|
||||
// with the /str option, or rebuild your VS project.
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class StringResources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal StringResources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the cached ResourceManager instance used by this class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("DTS.Viewer.Resources.StringResources", typeof(StringResources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overrides the current thread's CurrentUICulture property for all
|
||||
/// resource lookups using this strongly typed resource class.
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
internal static global::System.Globalization.CultureInfo Culture {
|
||||
get {
|
||||
return resourceCulture;
|
||||
}
|
||||
set {
|
||||
resourceCulture = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chart Options.
|
||||
/// </summary>
|
||||
internal static string ChartOptionsHeader {
|
||||
get {
|
||||
return ResourceManager.GetString("ChartOptionsHeader", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Graphs .
|
||||
/// </summary>
|
||||
internal static string GraphsDefaultTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("GraphsDefaultTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Modify.
|
||||
/// </summary>
|
||||
internal static string ModificationsHeader {
|
||||
get {
|
||||
return ResourceManager.GetString("ModificationsHeader", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Error occurred saving chart to PDF.
|
||||
/// </summary>
|
||||
internal static string SavePDFError {
|
||||
get {
|
||||
return ResourceManager.GetString("SavePDFError", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Chart saved succesfully as {0}{1} and {2}{3}.
|
||||
/// </summary>
|
||||
internal static string SavePDFSuccess {
|
||||
get {
|
||||
return ResourceManager.GetString("SavePDFSuccess", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Settings.
|
||||
/// </summary>
|
||||
internal static string SettingsTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("SettingsTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Test IDs.
|
||||
/// </summary>
|
||||
internal static string TestIDsDefaultTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("TestIDsDefaultTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Tests .
|
||||
/// </summary>
|
||||
internal static string TestsDefaultTitle {
|
||||
get {
|
||||
return ResourceManager.GetString("TestsDefaultTitle", resourceCulture);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using DTS.Common.Interface;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for NavigationView.xaml
|
||||
/// </summary>
|
||||
public partial class NavigationView : INavigationView
|
||||
{
|
||||
public NavigationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
public class ComponentsGroupControl : Control
|
||||
{
|
||||
public class ClickEventArgs : EventArgs
|
||||
{
|
||||
public ClickEventArgs()
|
||||
: base()
|
||||
{
|
||||
}
|
||||
}
|
||||
//public delegate void ClickEventHandler(Object sender, ClickEventArgs e);
|
||||
//public event ClickEventHandler OnClicked;
|
||||
|
||||
private static RoutedCommand _click;
|
||||
public static RoutedCommand ClickCommand
|
||||
{
|
||||
get { return _click; }
|
||||
}
|
||||
private static void OnCommandExecute(object sender, ExecutedRoutedEventArgs e)
|
||||
{
|
||||
var control = sender as ComponentsGroupControl;
|
||||
}
|
||||
private static void InitializeCommands()
|
||||
{
|
||||
_click = new RoutedCommand("ClickCommand", typeof(ComponentsGroupControl));
|
||||
CommandManager.RegisterClassCommandBinding(typeof(ComponentsGroupControl), new CommandBinding(_click, OnCommandExecute));
|
||||
}
|
||||
static ComponentsGroupControl()
|
||||
{
|
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(ComponentsGroupControl), new FrameworkPropertyMetadata(typeof(ComponentsGroupControl)));
|
||||
InitializeCommands();
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty ImageProperty = DependencyProperty.Register("Image", typeof(ImageSource), typeof(ComponentsGroupControl), new UIPropertyMetadata(null));
|
||||
|
||||
public ImageSource Image
|
||||
{
|
||||
get { return (ImageSource)GetValue(ImageProperty); }
|
||||
set { SetValue(ImageProperty, value); }
|
||||
}
|
||||
|
||||
|
||||
public static readonly DependencyProperty TitleProperty = DependencyProperty.Register("Title", typeof(string), typeof(ComponentsGroupControl), new UIPropertyMetadata("Title"));
|
||||
public string Title
|
||||
{
|
||||
get { return (string)GetValue(TitleProperty); }
|
||||
set { SetValue(TitleProperty, value); }
|
||||
}
|
||||
|
||||
/*public static readonly DependencyProperty SubtitleProperty = DependencyProperty.Register("Subtitle", typeof(string),
|
||||
typeof(ComponentsGroupControl), new UIPropertyMetadata("Subtitle"));
|
||||
public string Subtitle
|
||||
{
|
||||
get { return (string)GetValue(SubtitleProperty); }
|
||||
set { SetValue(SubtitleProperty, value); }
|
||||
}*/
|
||||
|
||||
|
||||
//public static readonly DependencyProperty TabItemProperty = DependencyProperty.Register("TabItem", typeof(AssemblyNameImage), typeof(ComponentsGroupControl), new PropertyMetadata());
|
||||
//public DataModel.TabPageItem TabItem
|
||||
//{
|
||||
// get { return (DataModel.TabPageItem)GetValue(TabItemProperty); }
|
||||
// set { SetValue(TabItemProperty, value); }
|
||||
//}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
using DTS.Common.Interface;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for TabView.xaml
|
||||
/// </summary>
|
||||
public partial class TabView : ITabView
|
||||
{
|
||||
public TabView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<base:BaseView x:Class="DTS.Viewer.DockPanelHorizontalView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common">
|
||||
<DockPanel MinWidth="1000" MinHeight="150">
|
||||
<ContentControl x:Name="MainTabRegion" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" MinHeight="150" MinWidth="1000">
|
||||
<ContentControl.Template>
|
||||
<ControlTemplate TargetType="ContentControl">
|
||||
<ContentPresenter Content="{TemplateBinding Content}" />
|
||||
</ControlTemplate>
|
||||
</ContentControl.Template>
|
||||
</ContentControl>
|
||||
</DockPanel>
|
||||
</base:BaseView>
|
||||
@@ -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="<<">
|
||||
<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="<<" />
|
||||
</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=">>" />
|
||||
</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>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
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.Prism.Regions;
|
||||
using Microsoft.Practices.Unity;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
public class NavigationViewModel : BaseViewModel<INavigationViewModel>, INavigationViewModel
|
||||
{
|
||||
public INavigationView NavigationView { get; private set; }
|
||||
private IShellViewModel Parent { get; 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 TechnologyDoFrontEditViewModel.
|
||||
/// </summary>
|
||||
/// <param name="view">The NavigationView 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 NavigationViewModel(INavigationView view, IRegionManager regionManager, IEventAggregator eventAggregator, IUnityContainer unityContainer)
|
||||
: base(regionManager, eventAggregator, unityContainer)
|
||||
{
|
||||
NavigationView = view;
|
||||
NavigationView.DataContext = this;
|
||||
NotificationRequest = new InteractionRequest<Notification>();
|
||||
ConfirmationRequest = new InteractionRequest<Confirmation>();
|
||||
|
||||
EventAggregator = eventAggregator;
|
||||
UnityContainer = unityContainer;
|
||||
_regionManager = regionManager;
|
||||
EventAggregator.GetEvent<RaiseNotification>().Subscribe(OnRaiseNotification);
|
||||
}
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override void Initialize(object parameter)
|
||||
{
|
||||
Parent = (IShellViewModel)parameter;
|
||||
|
||||
}
|
||||
|
||||
#region Methods
|
||||
|
||||
/// <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>
|
||||
/// Get all regions in the view
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
//public List<FrameworkElement> GetRegions()
|
||||
//{
|
||||
|
||||
// var items = new List<FrameworkElement>();
|
||||
// Utils.GetChildrenByName(((NavigationView)NavigationView).FrontShell, "Region", ref items);
|
||||
// return items;
|
||||
//}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region ContextRegion
|
||||
|
||||
public object ContextNavigationRegion
|
||||
{
|
||||
get { return ((NavigationView)NavigationView).NavigationRegion.Content; }
|
||||
set { ((NavigationView)NavigationView).NavigationRegion.Content = value; OnPropertyChanged("ContextNavigationRegion"); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
///<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));
|
||||
}
|
||||
}
|
||||
#region Properties
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets the HeaderInfo.
|
||||
/// </summary>
|
||||
public string HeaderInfo
|
||||
{
|
||||
get { return "NavigationRegion"; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public new bool IsBusy
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
set { throw new NotImplementedException(); }
|
||||
}
|
||||
|
||||
public override void Activated()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public new bool IsDirty
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
}
|
||||
|
||||
public override void Cleanup()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public new Task CleanupAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task InitializeAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task InitializeAsync(object parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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>
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
namespace DTS.Viewer.Properties
|
||||
{
|
||||
|
||||
|
||||
// This class allows you to handle specific events on the settings class:
|
||||
// The SettingChanging event is raised before a setting's value is changed.
|
||||
// The PropertyChanged event is raised after a setting's value is changed.
|
||||
// The SettingsLoaded event is raised after the setting values are loaded.
|
||||
// The SettingsSaving event is raised before the setting values are saved.
|
||||
internal sealed partial class Settings
|
||||
{
|
||||
|
||||
public Settings()
|
||||
{
|
||||
// // To add event handlers for saving and changing settings, uncomment the lines below:
|
||||
//
|
||||
// this.SettingChanging += this.SettingChangingEventHandler;
|
||||
//
|
||||
// this.SettingsSaving += this.SettingsSavingEventHandler;
|
||||
//
|
||||
}
|
||||
|
||||
private void SettingChangingEventHandler(object sender, System.Configuration.SettingChangingEventArgs e)
|
||||
{
|
||||
// Add code to handle the SettingChangingEvent event here.
|
||||
}
|
||||
|
||||
private void SettingsSavingEventHandler(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
// Add code to handle the SettingsSaving event here.
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,38 @@
|
||||
<base:BaseView x:Class="DTS.Viewer.MenuView"
|
||||
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:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
|
||||
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
|
||||
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
|
||||
Background="Silver" VerticalAlignment="Stretch" HorizontalAlignment="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>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Themes/Default.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</base:BaseView.Resources>
|
||||
|
||||
<ContentControl x:Name="MenuRegion" Background="LightGray">
|
||||
<ContentControl.Template>
|
||||
<ControlTemplate TargetType="ContentControl">
|
||||
<Grid>
|
||||
|
||||
<Label>Menu View</Label>
|
||||
<ContentPresenter Content="{TemplateBinding Content}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</ContentControl.Template>
|
||||
</ContentControl>
|
||||
</base:BaseView>
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
<base:BaseView x:Class="DTS.Viewer.NavigationView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:prism="clr-namespace:Microsoft.Practices.Prism.Regions;assembly=Microsoft.Practices.Prism"
|
||||
xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:classes="clr-namespace:DTS.Common.Classes;assembly=DTS.Common"
|
||||
xmlns:controls="clr-namespace:DTS.Common.Controls;assembly=DTS.Common"
|
||||
xmlns:base="clr-namespace:DTS.Common.Base;assembly=DTS.Common"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<i:Interaction.Triggers>
|
||||
|
||||
<!-- Display Notification Window -->
|
||||
<!--<interactionRequest:InteractionRequestTrigger SourceObject="{Binding NotificationRequest, Mode=OneWay}">
|
||||
<inf:PopupWindowAction IsModal="True" StartupPosition="CenterScreen"/>
|
||||
</interactionRequest:InteractionRequestTrigger>-->
|
||||
|
||||
</i:Interaction.Triggers>
|
||||
|
||||
<base:BaseView.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Themes/Default.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</base:BaseView.Resources>
|
||||
|
||||
<ContentControl x:Name="NavigationRegion" Background="LightGray">
|
||||
<ContentControl.Template>
|
||||
<ControlTemplate TargetType="ContentControl">
|
||||
<Grid>
|
||||
<controls:RoundedBox />
|
||||
<Label>Navigation View</Label>
|
||||
<ContentPresenter Content="{TemplateBinding Content}" />
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</ContentControl.Template>
|
||||
</ContentControl>
|
||||
</base:BaseView>
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace DTS.Viewer.Classes
|
||||
{
|
||||
public class NavigationItem
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
class MenuItem
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using DTS.Common.Events;
|
||||
using DTS.Common.Interface;
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
|
||||
using Microsoft.Practices.Prism.Regions;
|
||||
using Microsoft.Practices.Unity;
|
||||
using DTS.Common.Classes;
|
||||
using DTS.Common;
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Viewer
|
||||
{
|
||||
|
||||
public class MenuViewModel : BaseViewModel<IMenuViewModel>, IMenuViewModel
|
||||
{
|
||||
public IMenuView View { get; private set; }
|
||||
private IShellViewModel Parent { get; 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 MenuViewModel(IMenuView 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);
|
||||
}
|
||||
public override void Initialize()
|
||||
{
|
||||
//Load stuff
|
||||
int i = 10;
|
||||
|
||||
|
||||
}
|
||||
|
||||
public override void Initialize(object parameter)
|
||||
{
|
||||
Parent = (IShellViewModel)parameter;
|
||||
}
|
||||
|
||||
#region Methods
|
||||
|
||||
private void CreateViews(Boolean initialize)
|
||||
{
|
||||
try
|
||||
{
|
||||
//var viewDefinition = new ViewDefinition(RegionNames.MainRegion, typeof(IMainWindow), typeof(IMainWindowModel));
|
||||
//regionManager.AddView(viewDefinition, null);
|
||||
//--------------------------------------------------------------------------------
|
||||
// Create Views per each region
|
||||
//--------------------------------------------------------------------------------
|
||||
{
|
||||
var viewDefinition = new ViewDefinition(RegionNames.MainRegion, typeof(IBaseView), typeof(IBaseViewModel));
|
||||
//_regionManager.AddView(viewDefinition, null);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
//log errors
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
/// <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 PropertyChanged
|
||||
///<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));
|
||||
}
|
||||
}
|
||||
#endregion PropertyChanged
|
||||
|
||||
#region Properties
|
||||
|
||||
/// <summary>
|
||||
/// Gets the HeaderInfo.
|
||||
/// </summary>
|
||||
public string HeaderInfo
|
||||
{
|
||||
get
|
||||
{
|
||||
return "MainRegion";
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
public new bool IsBusy
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
set { throw new NotImplementedException(); }
|
||||
}
|
||||
|
||||
public override void Activated()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public new bool IsDirty
|
||||
{
|
||||
get { throw new NotImplementedException(); }
|
||||
}
|
||||
|
||||
public override void Cleanup()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public new Task CleanupAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task InitializeAsync()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public override Task InitializeAsync(object parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net45" />
|
||||
<package id="RibbonControlsLibrary" version="4.0.0" targetFramework="net45" />
|
||||
</packages>
|
||||
@@ -0,0 +1,144 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<data name="ChartOptionsHeader" xml:space="preserve">
|
||||
<value>Chart Options</value>
|
||||
</data>
|
||||
<data name="GraphsDefaultTitle" xml:space="preserve">
|
||||
<value>Graphs </value>
|
||||
</data>
|
||||
<data name="ModificationsHeader" xml:space="preserve">
|
||||
<value>Modify</value>
|
||||
</data>
|
||||
<data name="SavePDFError" xml:space="preserve">
|
||||
<value>Error occurred saving chart to PDF</value>
|
||||
</data>
|
||||
<data name="SavePDFSuccess" xml:space="preserve">
|
||||
<value>Chart saved succesfully as {0}{1} and {2}{3}</value>
|
||||
</data>
|
||||
<data name="SettingsTitle" xml:space="preserve">
|
||||
<value>Settings</value>
|
||||
</data>
|
||||
<data name="TestIDsDefaultTitle" xml:space="preserve">
|
||||
<value>Test IDs</value>
|
||||
</data>
|
||||
<data name="TestsDefaultTitle" xml:space="preserve">
|
||||
<value>Tests </value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user