init
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
namespace DTS.Common.Utils
|
||||
{
|
||||
public class XMLUtils
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,202 @@
|
||||
using System.Text;
|
||||
|
||||
namespace DTS.Common.ISO
|
||||
{
|
||||
public class IsoCode
|
||||
{
|
||||
private readonly char[] _isoCodeFull = { '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0' };
|
||||
|
||||
private char _testObject
|
||||
{
|
||||
get => _isoCodeFull[0];
|
||||
set => _isoCodeFull[0] = value;
|
||||
}
|
||||
|
||||
public string TestObject
|
||||
{
|
||||
get => new string(new[] { _testObject });
|
||||
set => _testObject = string.IsNullOrEmpty(value) ? '?' : value[0];
|
||||
}
|
||||
|
||||
private char _position
|
||||
{
|
||||
get => _isoCodeFull[1];
|
||||
set => _isoCodeFull[1] = value;
|
||||
}
|
||||
|
||||
public string Position
|
||||
{
|
||||
get => new string(new[]{_position});
|
||||
set => _position = string.IsNullOrEmpty(value) ? '?' : value[0];
|
||||
}
|
||||
private char[] _mainLocation
|
||||
{
|
||||
get => new[] { _isoCodeFull[2], _isoCodeFull[3], _isoCodeFull[4], _isoCodeFull[5] };
|
||||
set
|
||||
{
|
||||
for (var i = 0; i < 4; i++)
|
||||
{
|
||||
if (value.Length <= i) { _isoCodeFull[i + 2] = '0'; }
|
||||
else { _isoCodeFull[i + 2] = value[i]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public string MainLocation
|
||||
{
|
||||
get => new string(_mainLocation);
|
||||
set
|
||||
{
|
||||
var main = value;
|
||||
if (main.Length < 4) { main = main.PadRight(4, '?'); }
|
||||
else if (main.Length > 4) { main = main.Substring(0, 4); }
|
||||
_mainLocation = main.ToCharArray(0, 4);
|
||||
}
|
||||
}
|
||||
|
||||
private char[] _fineLocation1
|
||||
{
|
||||
get => new[] { _isoCodeFull[6], _isoCodeFull[7] };
|
||||
set
|
||||
{
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
_isoCodeFull[i + 6] = value.Length < i ? '0' : value[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
public string FineLocation1
|
||||
{
|
||||
get => new string(_fineLocation1);
|
||||
set
|
||||
{
|
||||
var loc = value;
|
||||
if (loc.Length < 2) { loc = loc.PadRight(2, '?'); }
|
||||
_fineLocation1 = loc.ToCharArray(0, 2);
|
||||
}
|
||||
}
|
||||
private char[] _fineLocation2
|
||||
{
|
||||
get => new[] { _isoCodeFull[8], _isoCodeFull[9] };
|
||||
set
|
||||
{
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
if (value.Length < i) { _isoCodeFull[i + 8] = '0'; }
|
||||
else { _isoCodeFull[i + 8] = value[i]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
public string FineLocation2
|
||||
{
|
||||
get => new string(_fineLocation2);
|
||||
set
|
||||
{
|
||||
var loc = value;
|
||||
if (loc.Length < 2) { loc = loc.PadRight(2, '?'); }
|
||||
_fineLocation2 = loc.ToCharArray(0, 2);
|
||||
}
|
||||
}
|
||||
private char[] _fineLocation3
|
||||
{
|
||||
get => new[] { _isoCodeFull[10], _isoCodeFull[11] };
|
||||
set
|
||||
{
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
if (value.Length < i) { _isoCodeFull[i + 10] = '0'; }
|
||||
else { _isoCodeFull[i + 10] = value[i]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
public string FineLocation3
|
||||
{
|
||||
get => new string(_fineLocation3);
|
||||
set
|
||||
{
|
||||
var loc = value;
|
||||
if (loc.Length < 2) { loc = loc.PadRight(2, '?'); }
|
||||
_fineLocation3 = loc.ToCharArray(0, 2);
|
||||
}
|
||||
}
|
||||
private char[] _physicalDimension
|
||||
{
|
||||
get => new[] { _isoCodeFull[12], _isoCodeFull[13] };
|
||||
set
|
||||
{
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
if (value.Length < i) { _isoCodeFull[i + 12] = '0'; }
|
||||
else { _isoCodeFull[i + 12] = value[i]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
public string PhysicalDimension
|
||||
{
|
||||
get => new string(_physicalDimension);
|
||||
set
|
||||
{
|
||||
var dim = value;
|
||||
if (dim.Length < 2) { dim = dim.PadRight(2, '?'); }
|
||||
else if (dim.Length > 2) { dim = dim.Substring(0, 2); }
|
||||
_physicalDimension = dim.ToCharArray(0, 2);
|
||||
}
|
||||
}
|
||||
|
||||
private char _direction
|
||||
{
|
||||
get => _isoCodeFull[14];
|
||||
set => _isoCodeFull[14] = value;
|
||||
}
|
||||
|
||||
public string Direction
|
||||
{
|
||||
get => new string(new[] { _direction });
|
||||
set
|
||||
{
|
||||
if (string.IsNullOrEmpty(value)) { _direction = '?'; }
|
||||
else { _direction = value[0]; }
|
||||
}
|
||||
}
|
||||
|
||||
private char _filterClass
|
||||
{
|
||||
get => _isoCodeFull[15];
|
||||
set => _isoCodeFull[15] = value;
|
||||
}
|
||||
|
||||
public string FilterClass
|
||||
{
|
||||
get => new string(new[] { _filterClass });
|
||||
set => _filterClass = string.IsNullOrEmpty(value) ? '?' : value[0];
|
||||
}
|
||||
|
||||
public IsoCode(string isoCode)
|
||||
{
|
||||
if (null == isoCode) { isoCode = ""; }
|
||||
if (isoCode.Length > 16) { isoCode = isoCode.Substring(0, 16); }
|
||||
if (isoCode.Length < 16)
|
||||
{
|
||||
isoCode = isoCode.PadRight(16, '?');
|
||||
}
|
||||
for (var i = 0; i < 16; i++) { _isoCodeFull[i] = isoCode[i]; }
|
||||
}
|
||||
public string StringRepresentation
|
||||
{
|
||||
get
|
||||
{
|
||||
var sb = new StringBuilder();
|
||||
foreach (var c in _isoCodeFull) { sb.Append(c); }
|
||||
return sb.ToString();
|
||||
}
|
||||
set
|
||||
{
|
||||
for (var i = 0; i < 16; i++)
|
||||
{
|
||||
if (i >= value.Length) { _isoCodeFull[i] = '0'; }
|
||||
else { _isoCodeFull[i] = value[i]; }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using Microsoft.Practices.Prism.Events;
|
||||
|
||||
namespace DTS.Common.Events
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// The TTSImportSavedChangesStatusEvent event.
|
||||
/// </summary>
|
||||
///
|
||||
/// <remarks>
|
||||
/// This event is used to communicate whether changes have been saved or not.
|
||||
/// </remarks>
|
||||
///
|
||||
public class TTSImportSavedChangesStatusEvent : CompositePresentationEvent<bool> { }
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.ComponentModel;
|
||||
|
||||
namespace DTS.Common.Interface.RegionOfInterest
|
||||
{
|
||||
public interface IRegionOfInterest : INotifyPropertyChanged
|
||||
{
|
||||
string Suffix { get; set; }
|
||||
double Start { get; set; }
|
||||
double End { get; set; }
|
||||
bool IsEnabled { get; set; }
|
||||
bool IsDefault { get; set; }
|
||||
string[] ChannelNames { get; set; }
|
||||
void SetChannelNamesNoNotify(string[] names);
|
||||
void ResetSuffix();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
using DTS.Common.Interface.StatusAndProgressBar;
|
||||
using DTS.Common.Utilities;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DTS.Common.Interface.DASFactory
|
||||
{
|
||||
public interface IDASFactory
|
||||
{
|
||||
bool PingAll();
|
||||
string Language { get; set; }
|
||||
void TakeOwnership();
|
||||
bool AllowSDBCommandPort { get; set; }
|
||||
double S6ConnectNewTimeout { get; set; }
|
||||
string [] SliceDBHostNames{ get;set; }
|
||||
string[] GetConnectedDevices();
|
||||
/// <summary>
|
||||
/// TDAS Host Names
|
||||
/// </summary>
|
||||
string [] TDASHostNames { get; set; }
|
||||
|
||||
string[] TDASSerialPortNames { get; set; }
|
||||
|
||||
string TDASSerialRackSerialNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// gets a list of all connected DAS devices.
|
||||
/// </summary>
|
||||
/// <returns>List of all connected DAS hardware</returns>
|
||||
List<IDASCommunication> GetDASList();
|
||||
|
||||
List<IDASCommunication> GetSortedDASList();
|
||||
/// <summary>
|
||||
/// Retrieves the ICommunication object of all hardware currently connected.
|
||||
/// </summary>
|
||||
/// <returns>List of ICommunications representing all hardware connected.</returns>
|
||||
List<ICommunication> GetDevList();
|
||||
/// <summary>
|
||||
/// Make DASFactory forget about all devices.
|
||||
/// </summary>
|
||||
void DetachAllDevices(bool detachUSB = false);
|
||||
|
||||
/// <summary>
|
||||
/// Initiate a refresh of the DASFactory (i.e. make sure GetDASList() reflects what's actually connected)
|
||||
/// </summary>
|
||||
/// <param name="action">The action to perform when the refresh is done</param>
|
||||
void Refresh(ActionCompleteDelegate action);
|
||||
/// <summary>
|
||||
/// configures the default timeout in ms for Multicast auto discovery receive functions
|
||||
/// </summary>
|
||||
int MultiCastAutoDiscoveryDefaultTimeoutMS { get; set; }
|
||||
SortableBindingList<IDiscoveredDevice> AutoDiscoverMulticast(bool discoverParents = true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
using DTS.Common.Base;
|
||||
|
||||
namespace DTS.Common
|
||||
{
|
||||
public interface IDownloadDataViewModel : IBaseViewModel
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:sys="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/DTS.Common;component/Themes/CommonStyles.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<sys:Double x:Key="MaxDropDownWidth">500</sys:Double>
|
||||
<!-- SimpleStyles: ComboBox -->
|
||||
<ControlTemplate x:Key="ComboBoxToggleButton" TargetType="ToggleButton">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="20" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Grid.ColumnSpan="1"
|
||||
Grid.Column="1"
|
||||
Background="{StaticResource Brush_FlatControlWindowBackground}"
|
||||
BorderBrush="{StaticResource NormalBorderBrush}"
|
||||
BorderThickness="0" />
|
||||
<Border
|
||||
x:Name="Content_Text"
|
||||
Grid.Column="0"
|
||||
Margin="0,0,1,0"
|
||||
VerticalAlignment="Stretch"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{DynamicResource Brush_FlatControlWindowBackground}"
|
||||
BorderBrush="{StaticResource DefaultedBorderBrush}"
|
||||
BorderThickness="0" />
|
||||
<Path
|
||||
x:Name="Arrow"
|
||||
Grid.Column="1"
|
||||
Fill="{StaticResource GlyphBrush}"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Data="M 0 0 L 4 4 L 8 0 Z"/>
|
||||
<Path
|
||||
x:Name="Lock"
|
||||
Grid.Column="0"
|
||||
Data="M5.5,3.5730734 C5.152669,3.5730734 4.8814287,3.5981388 4.6862793,3.6482687 C4.4911294,3.6983995 4.3452148,3.780756 4.2485352,3.895339 C4.1518555,4.0099225 4.0918779,4.1612082 4.0686035,4.3491964 C4.0453286,4.5371847 4.0336914,4.7672467 4.0336914,5.039382 L4.0336914,5.8826437 L6.9663086,5.8826437 L6.9663086,5.039382 C6.9663086,4.7672467 6.9555664,4.5371847 6.934082,4.3491964 C6.9125977,4.1612082 6.8544106,4.0099225 6.7595215,3.895339 C6.6646318,3.780756 6.5187173,3.6983995 6.3217773,3.6482687 C6.1248369,3.5981388 5.8509111,3.5730734 5.5,3.5730734 z M5.5,2.461257 C6.0514321,2.461257 6.4945474,2.5266056 6.8293457,2.6573019 C7.1641436,2.7879992 7.4219561,2.9688253 7.6027832,3.1997824 C7.7836099,3.4307399 7.9035645,3.7037706 7.9626465,4.0188742 C8.0217285,4.3339787 8.0512695,4.6741476 8.0512695,5.039382 L8.0512695,5.9094992 C8.1515293,5.9094992 8.248209,5.9291935 8.3413086,5.9685812 C8.4344072,6.0079694 8.5158691,6.0607853 8.5856934,6.1270285 C8.6555176,6.1932721 8.7110186,6.2702579 8.7521973,6.3579855 C8.793375,6.4457135 8.8139648,6.5379171 8.8139648,6.6345968 L8.8139648,10.67903 C8.8139648,10.782871 8.795166,10.879551 8.7575684,10.969069 C8.7199707,11.058588 8.6671543,11.138259 8.5991211,11.208083 C8.5310869,11.277907 8.4523106,11.332514 8.362793,11.371902 C8.2732744,11.411289 8.1783848,11.430984 8.078125,11.430984 L2.9379883,11.430984 C2.834147,11.430984 2.7365723,11.411289 2.6452637,11.371902 C2.5539551,11.332514 2.4742837,11.277907 2.40625,11.208083 C2.3382161,11.138259 2.2845051,11.058588 2.2451172,10.969069 C2.205729,10.879551 2.1860352,10.782871 2.1860352,10.67903 L2.1860352,6.6345968 C2.1860352,6.5379171 2.2066243,6.4457135 2.2478027,6.3579855 C2.288981,6.2702579 2.3444824,6.1932721 2.4143066,6.1270285 C2.4841309,6.0607853 2.563802,6.0079694 2.6533203,5.9685812 C2.7428384,5.9291935 2.8377278,5.9094992 2.9379883,5.9094992 L2.9379883,5.039382 C2.9379883,4.6741476 2.9684243,4.3339787 3.0292969,4.0188742 C3.0901692,3.7037706 3.2128091,3.4307399 3.3972168,3.1997824 C3.581624,2.9688253 3.8412271,2.7879992 4.1760254,2.6573019 C4.5108232,2.5266056 4.9521484,2.461257 5.5,2.461257 z"
|
||||
HorizontalAlignment="Right"
|
||||
Height="8.97" Margin="5" Stretch="Fill"
|
||||
VerticalAlignment="Center"
|
||||
Width="6.628"/>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="ToggleButton.IsMouseOver" Value="true">
|
||||
<Setter TargetName="Border" Property="Background" Value="{StaticResource Brush_FlatControlMouseOverBackground}" />
|
||||
<Setter TargetName="Content_Text" Property="Background" Value="{StaticResource Brush_FlatControlMouseOverBackground}" />
|
||||
</Trigger>
|
||||
<Trigger Property="ToggleButton.IsChecked" Value="true">
|
||||
<Setter TargetName="Border" Property="Background" Value="{StaticResource Brush_FlatControlMouseOverBackground}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="Lock" Property="Fill" Value="{StaticResource Brush_FlatControlDisabledForeground}"/>
|
||||
<Setter TargetName="Border" Property="Background" Value="{StaticResource Brush_FlatControlDisabledBackground}" />
|
||||
<Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource Brush_FlatControlBorder}" />
|
||||
<Setter Property="Foreground" Value="{StaticResource Brush_FlatControlDisabledForeground}"/>
|
||||
<Setter TargetName="Content_Text" Property="Background" Value="{StaticResource Brush_FlatControlDisabledBackground}"/>
|
||||
<Setter TargetName="Arrow" Property="Fill" Value="{StaticResource Brush_FlatControlDisabledForeground}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="ComboBoxTextBox" TargetType="TextBox" >
|
||||
<Border x:Name="PART_ContentHost" Focusable="False" Background="{TemplateBinding Background}" />
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="FlatComboBoxStyle" TargetType="ComboBox">
|
||||
<Setter Property="SnapsToDevicePixels" Value="true"/>
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<!--7873 Font size is smaller in Name field than in combo-box fields-->
|
||||
<Setter Property="FontFamily" Value="Segoe UI" />
|
||||
<Setter Property="MinWidth" Value="40"/>
|
||||
<Setter Property="Height" Value="22" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="Margin" Value="5,2,5,2"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<Grid>
|
||||
<ToggleButton Name="ToggleButton"
|
||||
Template="{StaticResource ComboBoxToggleButton}"
|
||||
Grid.Column="2"
|
||||
Focusable="false"
|
||||
IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ClickMode="Press">
|
||||
</ToggleButton>
|
||||
<ContentPresenter Name="ContentSite"
|
||||
IsHitTestVisible="False"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
||||
Margin="3,0,23,0"
|
||||
VerticalAlignment="Center"
|
||||
TextBlock.Foreground="{TemplateBinding Foreground}"
|
||||
TextBlock.FontSize="{TemplateBinding FontSize}"
|
||||
HorizontalAlignment="Left" />
|
||||
<TextBox x:Name="PART_EditableTextBox"
|
||||
Style="{x:Null}"
|
||||
Template="{StaticResource ComboBoxTextBox}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Margin="3,0,23,0"
|
||||
Focusable="True"
|
||||
Background="Transparent"
|
||||
Visibility="Hidden"
|
||||
IsReadOnly="{TemplateBinding IsReadOnly}"/>
|
||||
<Popup Name="Popup"
|
||||
Placement="Bottom"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
AllowsTransparency="True"
|
||||
Focusable="False"
|
||||
PopupAnimation="Slide">
|
||||
<Grid Name="DropDown"
|
||||
SnapsToDevicePixels="True"
|
||||
TextBlock.FontSize="{TemplateBinding FontSize}"
|
||||
MaxWidth="{TemplateBinding ActualWidth}"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
||||
<Border x:Name="DropDownBorder"
|
||||
Background="{StaticResource Brush_FlatControlWindowBackground}"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{StaticResource SolidBorderBrush}"/>
|
||||
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True" Visibility="Visible">
|
||||
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{StaticResource Brush_FlatControlDisabledForeground}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsGrouping" Value="true">
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
|
||||
</Trigger>
|
||||
<Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
|
||||
<Setter TargetName="DropDownBorder" Property="Margin" Value="0,0,0,0"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEditable" Value="true">
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible"/>
|
||||
<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="FlatComboBoxStyleWideDrop" TargetType="ComboBox">
|
||||
<Setter Property="SnapsToDevicePixels" Value="true"/>
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
|
||||
<Setter Property="FontSize" Value="16" />
|
||||
<!--7873 Font size is smaller in Name field than in combo-box fields-->
|
||||
<Setter Property="FontFamily" Value="Segoe UI" />
|
||||
<Setter Property="MinWidth" Value="40"/>
|
||||
<Setter Property="Height" Value="22" />
|
||||
<Setter Property="VerticalAlignment" Value="Stretch" />
|
||||
<Setter Property="Margin" Value="5,2,5,2"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<Grid>
|
||||
<ToggleButton Name="ToggleButton"
|
||||
Template="{StaticResource ComboBoxToggleButton}"
|
||||
Grid.Column="2"
|
||||
Focusable="false"
|
||||
IsChecked="{Binding Path=IsDropDownOpen,Mode=TwoWay,RelativeSource={RelativeSource TemplatedParent}}"
|
||||
ClickMode="Press">
|
||||
</ToggleButton>
|
||||
<ContentPresenter Name="ContentSite"
|
||||
IsHitTestVisible="False"
|
||||
Content="{TemplateBinding SelectionBoxItem}"
|
||||
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
|
||||
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
|
||||
Margin="3,0,23,0"
|
||||
VerticalAlignment="Center"
|
||||
TextBlock.Foreground="{TemplateBinding Foreground}"
|
||||
TextBlock.FontSize="{TemplateBinding FontSize}"
|
||||
HorizontalAlignment="Left" />
|
||||
<TextBox x:Name="PART_EditableTextBox"
|
||||
Style="{x:Null}"
|
||||
Template="{StaticResource ComboBoxTextBox}"
|
||||
FontSize="{TemplateBinding FontSize}"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Margin="3,0,23,0"
|
||||
Focusable="True"
|
||||
Background="Transparent"
|
||||
Visibility="Hidden"
|
||||
IsReadOnly="{TemplateBinding IsReadOnly}"/>
|
||||
<Popup Name="Popup"
|
||||
Placement="Bottom"
|
||||
IsOpen="{TemplateBinding IsDropDownOpen}"
|
||||
AllowsTransparency="True"
|
||||
Focusable="False"
|
||||
PopupAnimation="Slide">
|
||||
<Grid Name="DropDown"
|
||||
SnapsToDevicePixels="True"
|
||||
TextBlock.FontSize="{TemplateBinding FontSize}"
|
||||
MaxWidth="{StaticResource MaxDropDownWidth}"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
||||
<Border x:Name="DropDownBorder"
|
||||
Background="{StaticResource Brush_FlatControlWindowBackground}"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{StaticResource SolidBorderBrush}"/>
|
||||
<ScrollViewer Margin="4,6,4,6" SnapsToDevicePixels="True" Visibility="Visible">
|
||||
<StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" />
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="HasItems" Value="false">
|
||||
<Setter TargetName="DropDownBorder" Property="MinHeight" Value="95"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{StaticResource Brush_FlatControlDisabledForeground}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsGrouping" Value="true">
|
||||
<Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
|
||||
</Trigger>
|
||||
<Trigger SourceName="Popup" Property="Popup.AllowsTransparency" Value="true">
|
||||
<Setter TargetName="DropDownBorder" Property="Margin" Value="0,0,0,0"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEditable" Value="true">
|
||||
<Setter Property="IsTabStop" Value="false"/>
|
||||
<Setter TargetName="PART_EditableTextBox" Property="Visibility" Value="Visible"/>
|
||||
<Setter TargetName="ContentSite" Property="Visibility" Value="Hidden"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<!-- SimpleStyles: ComboBoxItem -->
|
||||
<Style x:Key="{x:Type ComboBoxItem}" TargetType="ComboBoxItem">
|
||||
<Setter Property="SnapsToDevicePixels" Value="true"/>
|
||||
<Setter Property="OverridesDefaultStyle" Value="true"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBoxItem">
|
||||
<Border
|
||||
Name="Border"
|
||||
Padding="0"
|
||||
SnapsToDevicePixels="true">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsHighlighted" Value="true">
|
||||
<Setter TargetName="Border" Property="Background" Value="{StaticResource Brush_FlatControlSelectedBackground}"/>
|
||||
<Setter Property="Foreground" Value="{StaticResource Brush_FlatControlSelectedForeground}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="Foreground" Value="{StaticResource Brush_FlatControlForeground}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="{x:Type ComboBox}" TargetType="ComboBox" BasedOn="{StaticResource FlatComboBoxStyle}" />
|
||||
|
||||
<Style x:Key="PageContentComboBoxStyle" TargetType="ComboBox" BasedOn="{StaticResource FlatComboBoxStyle}" >
|
||||
<Setter Property="Margin" Value="5,2,5,2" />
|
||||
<Setter Property="Height" Value="22" />
|
||||
</Style>
|
||||
<Style x:Key="PageContentComboBoxErrorStyle" TargetType="ComboBox" BasedOn="{StaticResource PageContentComboBoxStyle}">
|
||||
<Setter Property="BorderThickness" Value="2" />
|
||||
<Setter Property="BorderBrush" Value="Red" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user