123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332 |
- <Window
- x:Class="ShakerManger.MainWindow"
- 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:data="clr-namespace:ShakerManger.Data"
- xmlns:hc="https://handyorg.github.io/handycontrol"
- xmlns:local="clr-namespace:ShakerManger"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:system="clr-namespace:System;assembly=mscorlib"
- xmlns:view="clr-namespace:ShakerManger.View"
- xmlns:vm="clr-namespace:ShakerManger.ViewModel"
- Title="MainWindow"
- Width="{x:Static SystemParameters.PrimaryScreenWidth}"
- Height="{x:Static SystemParameters.PrimaryScreenHeight}"
- d:DataContext="{d:DesignInstance {x:Type vm:MainWindowViewModel}}"
- BorderThickness="0"
- DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data}"
- Left="0"
- ResizeMode="NoResize"
- Top="0"
- Topmost="True"
- WindowStartupLocation="Manual"
- WindowState="Normal"
- WindowStyle="None"
- mc:Ignorable="d">
- <Window.Resources>
- <Geometry x:Key="MainGeometry">M0,0 L1920,0 L1920,100 L1680,100 L1610,20 L600,20 L530,100 L0,100Z</Geometry>
- <vm:BindingProxy x:Key="DeviceControl" Data="{x:Static system:Boolean.FalseString}" />
- </Window.Resources>
- <Window.Background>
- <ImageBrush ImageSource="/Resources/background.png" Opacity="0.6" />
- </Window.Background>
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Closing">
- <hc:InvokeCommandAction Command="{Binding CloseCommand}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- <WindowChrome.WindowChrome>
- <WindowChrome
- CaptionHeight="0"
- CornerRadius="0"
- GlassFrameThickness="0"
- ResizeBorderThickness="0" />
- </WindowChrome.WindowChrome>
- <Viewbox Stretch="Fill">
- <Grid Width="1920" Height="1080">
- <Grid.Style>
- <Style TargetType="Grid">
- <Setter Property="IsEnabled">
- <Setter.Value>
- <MultiBinding
- Converter="{StaticResource MainWindowEnabledConverter}"
- ConverterParameter="1"
- Mode="OneWay">
- <Binding
- Mode="OneWay"
- Path="Data.IsOpen"
- Source="{StaticResource Prompt}" />
- <Binding
- Converter="{StaticResource Boolean2BooleanReConverter}"
- Mode="OneWay"
- Path="Data.IsLoggedIn"
- Source="{StaticResource Login}" />
- <Binding
- Mode="OneWay"
- Path="Data"
- Source="{StaticResource DeviceControl}" />
- <Binding
- Mode="OneWay"
- Path="IsOpen"
- Source="{x:Static vm:ProgressViewModel.Default}" />
- </MultiBinding>
- </Setter.Value>
- </Setter>
- </Style>
- </Grid.Style>
- <Grid.RowDefinitions>
- <RowDefinition Height="120" />
- <RowDefinition Height="*" />
- <RowDefinition Height="20" />
- </Grid.RowDefinitions>
- <StackPanel
- Grid.Row="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <Viewbox Width="28" Height="28">
- <Path Data="{StaticResource CEAPGepmetry}" Fill="Red" />
- </Viewbox>
- <TextBlock
- Margin="10,0,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="14"
- Foreground="White"
- Text="中国工程物理研究院总体工程研究所" />
- </StackPanel>
- <Grid>
- <Viewbox Margin="10" Stretch="Fill">
- <Path
- Data="{StaticResource MainGeometry}"
- Stroke="#1F6cd7ea"
- StrokeThickness="1">
- <Path.Effect>
- <DropShadowEffect
- BlurRadius="20"
- Opacity="1"
- ShadowDepth="0"
- Color="{StaticResource ButtonEffectColor}" />
- </Path.Effect>
- </Path>
- </Viewbox>
- <Viewbox Margin="10" Stretch="Fill">
- <hc:AnimationPath
- Data="{StaticResource MainGeometry}"
- Stroke="Blue"
- StrokeThickness="2"
- Duration="0:0:5" />
- </Viewbox>
- <TextBlock
- Margin="20,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="52"
- Foreground="{StaticResource WindowTitleColor}"
- Text="{StaticResource Title}" />
- <ListView
- Height="60"
- Margin="560,40,320,0"
- IsEnabled="{Binding IsEnabled}"
- ItemsSource="{Binding MainPages}"
- SelectedValue="{Binding CurrentMainPage}">
- <ListView.Style>
- <Style TargetType="ListView" BasedOn="{x:Null}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListView">
- <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemTemplate">
- <Setter.Value>
- <DataTemplate>
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
- Orientation="Horizontal">
- <Grid>
- <Viewbox Stretch="Fill" Width="200">
- <Path Data="M70,0 L270,0 L200,70 L00,70Z">
- <Path.Style>
- <Style TargetType="Path">
- <Style.Triggers>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListViewItem}, Path=IsSelected}" Value="True">
- <Setter Property="Fill">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0.45,0" EndPoint="0.55,1">
- <GradientStop Offset="0" Color="#1A5eea" />
- <GradientStop Offset="1" Color="#1A7eff" />
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ListViewItem}, Path=IsSelected}" Value="False">
- <Setter Property="Fill">
- <Setter.Value>
- <RadialGradientBrush Center="0.5,0.5">
- <GradientStop Color="#01015EEA" />
- <GradientStop Offset="1" Color="#3F007EFF" />
- </RadialGradientBrush>
- </Setter.Value>
- </Setter>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Path.Style>
- <Path.Effect>
- <DropShadowEffect
- BlurRadius="20"
- Opacity="1"
- RenderingBias="Quality"
- ShadowDepth="0"
- Color="{StaticResource ButtonEffectColor}" />
- </Path.Effect>
- </Path>
- </Viewbox>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="22"
- Foreground="{StaticResource SystemItemsForeColor}"
- Text="{Binding MainPageType, Converter={StaticResource EnumToDescription}}" />
- </Grid>
- </StackPanel>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <Style TargetType="ListViewItem">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="True" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <ContentPresenter
- Margin="0,0,0,0"
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- ContentTemplateSelector="{x:Null}"
- IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemsPanel">
- <Setter.Value>
- <ItemsPanelTemplate>
- <UniformGrid
- Margin="0"
- Rows="1"
- Style="{x:Null}" />
- </ItemsPanelTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ListView.Style>
- </ListView>
- <TextBlock
- Margin="0,20,20,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Top"
- FontSize="24"
- Foreground="Aqua"
- Text="{Binding NowTime, StringFormat=yyyy-MM-dd HH:mm:ss}" />
- <StackPanel
- Margin="0,0,20,20"
- HorizontalAlignment="Right"
- VerticalAlignment="Bottom"
- Background="Transparent"
- Orientation="Horizontal">
- <Button
- Width="42"
- Height="42"
- VerticalAlignment="Center"
- hc:IconElement.Geometry="{StaticResource DeviceControlGeometry}"
- Cursor="Hand"
- IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
- Style="{StaticResource ImageButton}"
- ToolTip="设备控制">
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Click">
- <hc:SetPropertyAction
- PropertyName="Data"
- PropertyValue="{x:Static system:Boolean.TrueString}"
- TargetObject="{Binding Source={StaticResource DeviceControl}}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </Button>
- <Grid Margin="20,0,0,0">
- <Button
- Width="42"
- Height="42"
- hc:IconElement.Geometry="m63.94311,0l668.44444,0c32.99556,0 60.13156,24.91733 63.71556,56.94578l0.34133,6.99733l0,668.55822c0,32.99556 -24.91733,60.07467 -56.94578,63.54489l-6.99733,0.39822l-668.55822,0c-32.99556,0 -60.07467,-24.91733 -63.54489,-56.94578l-0.39822,-6.99733l0,-668.55822c0,-32.99556 24.91733,-60.07467 56.94578,-63.54489l6.99733,-0.39822l668.44444,0l-668.44444,0zm107.06489,56.88889l-114.11911,0l0,682.66666l682.66666,0l0,-682.66666l-114.11911,0l0.22756,3.47022l0.11378,3.584l0,213.44711c0,32.99556 -21.33334,60.07467 -48.81067,63.54489l-5.97333,0.39822l-345.54312,0c-28.27377,0 -51.48444,-24.91733 -54.44266,-56.94578l-0.34134,-6.99733l0,-213.44711c0,-2.38933 0.11378,-4.72178 0.34134,-7.05422zm397.88089,0l-341.33334,0l0,227.55555l341.33334,0l0,-227.55555zm-85.33334,56.88889a28.44444,28.44444 0 0 1 28.44445,28.44444l0,56.88889a28.44444,28.44444 0 1 1 -56.88889,0l0,-56.88889a28.44444,28.44444 0 0 1 28.44444,-28.44444z"
- Background="Transparent"
- Command="{Binding SaveDataCommand}"
- Cursor="Hand">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
- <Style.Triggers>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled}" Value="True" />
- <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="False" />
- </MultiDataTrigger.Conditions>
- <Setter Property="IsEnabled" Value="True" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled}" Value="False" />
- <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="False" />
- </MultiDataTrigger.Conditions>
- <Setter Property="IsEnabled" Value="False" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled}" Value="False" />
- <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="True" />
- </MultiDataTrigger.Conditions>
- <Setter Property="IsEnabled" Value="False" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled}" Value="True" />
- <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="True" />
- </MultiDataTrigger.Conditions>
- <Setter Property="IsEnabled" Value="False" />
- </MultiDataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- <Viewbox
- Width="20"
- Height="20"
- Margin="0,10,0,0"
- IsHitTestVisible="False"
- Visibility="{Binding IsSaveData, Converter={StaticResource Boolean2VisibilityConverter}}">
- <Path
- Data="m0,508.958c0,-37.982 30.385,-68.367 68.367,-68.367c45.578,0 75.964,30.385 75.964,68.367c0,45.578 -30.385,75.964 -75.964,75.964c-37.982,0 -68.367,-30.385 -68.367,-75.964zm91.157,-265.873l0,0c0,-53.175 37.982,-98.753 91.157,-98.753s98.753,45.578 98.753,98.753l0,0c0,53.175 -45.578,91.157 -98.753,91.157s-91.157,-37.982 -91.157,-91.157l0,0zm37.982,539.344l0,0c0,-30.385 22.789,-53.175 53.175,-53.175s53.175,22.789 53.175,53.175l0,0c0,30.385 -22.789,53.175 -53.175,53.175s-53.175,-22.789 -53.175,-53.175zm265.874,113.946l0,0c0,-37.982 22.789,-60.772 60.772,-60.772s60.772,22.789 60.772,60.772l0,0c0,37.982 -22.789,60.772 -60.772,60.772c-37.982,0 -60.772,-22.789 -60.772,-60.772zm296.26,-113.946c0,-22.789 15.193,-37.982 37.982,-37.982s37.982,15.193 37.982,37.982c0,22.789 -15.193,37.982 -37.982,37.982c-22.789,0 -37.982,-15.193 -37.982,-37.982zm83.56,-273.471c0,-30.385 30.385,-60.772 68.367,-60.772c30.385,0 60.772,30.385 60.772,60.772c0,37.982 -30.385,68.367 -60.772,68.367c-37.982,0 -68.367,-30.385 -68.367,-68.367zm-174.717,-265.873c0,-75.964 60.772,-129.139 129.139,-129.139s129.139,53.175 129.139,129.139c0,68.367 -60.772,129.139 -129.139,129.139c-68.367,0 -129.139,-60.772 -129.139,-129.139zm-273.47,-113.946c0,-68.367 60.772,-129.139 129.139,-129.139s129.139,60.772 129.139,129.139c0,68.367 -60.772,129.139 -129.139,129.139c-68.367,0 -129.139,-60.772 -129.139,-129.139z"
- Fill="Green"
- RenderTransformOrigin="0.5,0.5">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform Angle="0" />
- <TranslateTransform />
- </TransformGroup>
- </Path.RenderTransform>
- <Path.Triggers>
- <EventTrigger RoutedEvent="Loaded">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation
- AutoReverse="False"
- RepeatBehavior="Forever"
- SpeedRatio="1"
- Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
- From="0"
- To="360"
- Duration="0:0:1" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </Path.Triggers>
- </Path>
- </Viewbox>
- </Grid>
- <Button
- Width="42"
- Height="42"
- Margin="20,0,0,0"
- VerticalAlignment="Center"
- hc:IconElement.Geometry="{StaticResource LayoutGeometry}"
- Cursor="Hand"
- IsEnabled="{Binding LayoutVisibily}">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.ShakerManger}">
- <Setter Property="Visibility" Value="Visible" />
- </DataTrigger>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.ConfigManger}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.DataManger}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.LogManger}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.WarnManger}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Click">
- <hc:SetPropertyAction
- PropertyName="IsOpen"
- PropertyValue="{x:Static system:Boolean.TrueString}"
- TargetObject="{Binding LayoutManger}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </Button>
- <Button
- Width="42"
- Height="42"
- Margin="20,0,0,0"
- VerticalAlignment="Center"
- hc:IconElement.Geometry="{StaticResource CloseGeometry}"
- Command="{Binding ExitCommand}"
- Cursor="Hand"
- Style="{StaticResource ImageButton}"
- ToolTip="关闭" />
- </StackPanel>
- </Grid>
- <Border
- Grid.ColumnSpan="2"
- Background="{StaticResource TitleBackColor}"
- Visibility="Collapsed">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="400" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="200" />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <TextBlock
- Margin="20,0,10,0"
- VerticalAlignment="Center"
- FontSize="36"
- FontWeight="Bold"
- Text="{StaticResource Title}" />
- <ListView
- Grid.Column="1"
- Margin="20,0,20,0"
- IsEnabled="{Binding IsEnabled}"
- ItemsSource="{Binding MainPages}"
- SelectedValue="{Binding CurrentMainPage}">
- <ListView.Style>
- <Style TargetType="ListView" BasedOn="{x:Null}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListView">
- <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemTemplate">
- <Setter.Value>
- <DataTemplate>
- <StackPanel
- Margin="0"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Background="Transparent"
- IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=Anonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
- Orientation="Horizontal">
- <Viewbox
- Width="32"
- Height="32"
- HorizontalAlignment="Right"
- VerticalAlignment="Center">
- <Path Data="{Binding IconPath}" Fill="{StaticResource SystemItemsForeColor}" />
- </Viewbox>
- <TextBlock
- Grid.Column="1"
- Margin="20,0,0,0"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="22"
- Foreground="{StaticResource SystemItemsForeColor}"
- Text="{Binding MainPageType, Converter={StaticResource EnumToDescription}}" />
- </StackPanel>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <Style TargetType="ListViewItem">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="True" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="IsEnabled" Value="{Binding IsEnabled}" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <Border
- x:Name="backcolor"
- Margin="0"
- Padding="0"
- CornerRadius="12,12,0,0">
- <ContentPresenter
- Margin="0"
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- ContentTemplateSelector="{x:Null}"
- IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=Anonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="True">
- <Setter TargetName="backcolor" Property="Background" Value="{StaticResource SystemItemsSelectBackColor}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemsPanel">
- <Setter.Value>
- <ItemsPanelTemplate>
- <UniformGrid
- Margin="0"
- Rows="1"
- Style="{x:Null}" />
- </ItemsPanelTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ListView.Style>
- </ListView>
- <UniformGrid Grid.Column="2" Rows="1">
- <Button
- Width="42"
- Height="42"
- Padding="0"
- hc:IconElement.Geometry="{StaticResource StartGeometry}"
- Command="{Binding StartAllCommand}"
- IsEnabled="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
- Style="{StaticResource ImageButton}"
- ToolTip="全部开始" />
- <Button
- Width="42"
- Height="42"
- Padding="0"
- hc:IconElement.Geometry="{StaticResource StopGeometry}"
- Command="{Binding StopAllCommand}"
- IsEnabled="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}"
- Style="{StaticResource ImageButton}"
- ToolTip="全部停止" />
- </UniformGrid>
- <StackPanel
- Grid.Column="3"
- Margin="40,0,10,0"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <Grid>
- <Button
- Width="42"
- Height="42"
- hc:IconElement.Geometry="m63.94311,0l668.44444,0c32.99556,0 60.13156,24.91733 63.71556,56.94578l0.34133,6.99733l0,668.55822c0,32.99556 -24.91733,60.07467 -56.94578,63.54489l-6.99733,0.39822l-668.55822,0c-32.99556,0 -60.07467,-24.91733 -63.54489,-56.94578l-0.39822,-6.99733l0,-668.55822c0,-32.99556 24.91733,-60.07467 56.94578,-63.54489l6.99733,-0.39822l668.44444,0l-668.44444,0zm107.06489,56.88889l-114.11911,0l0,682.66666l682.66666,0l0,-682.66666l-114.11911,0l0.22756,3.47022l0.11378,3.584l0,213.44711c0,32.99556 -21.33334,60.07467 -48.81067,63.54489l-5.97333,0.39822l-345.54312,0c-28.27377,0 -51.48444,-24.91733 -54.44266,-56.94578l-0.34134,-6.99733l0,-213.44711c0,-2.38933 0.11378,-4.72178 0.34134,-7.05422zm397.88089,0l-341.33334,0l0,227.55555l341.33334,0l0,-227.55555zm-85.33334,56.88889a28.44444,28.44444 0 0 1 28.44445,28.44444l0,56.88889a28.44444,28.44444 0 1 1 -56.88889,0l0,-56.88889a28.44444,28.44444 0 0 1 28.44444,-28.44444z"
- Command="{Binding SaveDataCommand}"
- Cursor="Hand">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
- <Style.Triggers>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled}" Value="True" />
- <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="False" />
- </MultiDataTrigger.Conditions>
- <Setter Property="IsEnabled" Value="True" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled}" Value="False" />
- <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="False" />
- </MultiDataTrigger.Conditions>
- <Setter Property="IsEnabled" Value="False" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled}" Value="False" />
- <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="True" />
- </MultiDataTrigger.Conditions>
- <Setter Property="IsEnabled" Value="False" />
- </MultiDataTrigger>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsEnabled}" Value="True" />
- <Condition Binding="{Binding Source={StaticResource Login}, Path=Data.IsAnonymous}" Value="True" />
- </MultiDataTrigger.Conditions>
- <Setter Property="IsEnabled" Value="False" />
- </MultiDataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- <Viewbox
- Width="20"
- Height="20"
- Margin="0,10,0,0"
- IsHitTestVisible="False"
- Visibility="{Binding IsSaveData, Converter={StaticResource Boolean2VisibilityConverter}}">
- <Path
- Data="m0,508.958c0,-37.982 30.385,-68.367 68.367,-68.367c45.578,0 75.964,30.385 75.964,68.367c0,45.578 -30.385,75.964 -75.964,75.964c-37.982,0 -68.367,-30.385 -68.367,-75.964zm91.157,-265.873l0,0c0,-53.175 37.982,-98.753 91.157,-98.753s98.753,45.578 98.753,98.753l0,0c0,53.175 -45.578,91.157 -98.753,91.157s-91.157,-37.982 -91.157,-91.157l0,0zm37.982,539.344l0,0c0,-30.385 22.789,-53.175 53.175,-53.175s53.175,22.789 53.175,53.175l0,0c0,30.385 -22.789,53.175 -53.175,53.175s-53.175,-22.789 -53.175,-53.175zm265.874,113.946l0,0c0,-37.982 22.789,-60.772 60.772,-60.772s60.772,22.789 60.772,60.772l0,0c0,37.982 -22.789,60.772 -60.772,60.772c-37.982,0 -60.772,-22.789 -60.772,-60.772zm296.26,-113.946c0,-22.789 15.193,-37.982 37.982,-37.982s37.982,15.193 37.982,37.982c0,22.789 -15.193,37.982 -37.982,37.982c-22.789,0 -37.982,-15.193 -37.982,-37.982zm83.56,-273.471c0,-30.385 30.385,-60.772 68.367,-60.772c30.385,0 60.772,30.385 60.772,60.772c0,37.982 -30.385,68.367 -60.772,68.367c-37.982,0 -68.367,-30.385 -68.367,-68.367zm-174.717,-265.873c0,-75.964 60.772,-129.139 129.139,-129.139s129.139,53.175 129.139,129.139c0,68.367 -60.772,129.139 -129.139,129.139c-68.367,0 -129.139,-60.772 -129.139,-129.139zm-273.47,-113.946c0,-68.367 60.772,-129.139 129.139,-129.139s129.139,60.772 129.139,129.139c0,68.367 -60.772,129.139 -129.139,129.139c-68.367,0 -129.139,-60.772 -129.139,-129.139z"
- Fill="Green"
- RenderTransformOrigin="0.5,0.5">
- <Path.RenderTransform>
- <TransformGroup>
- <ScaleTransform />
- <SkewTransform />
- <RotateTransform Angle="0" />
- <TranslateTransform />
- </TransformGroup>
- </Path.RenderTransform>
- <Path.Triggers>
- <EventTrigger RoutedEvent="Loaded">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation
- AutoReverse="False"
- RepeatBehavior="Forever"
- SpeedRatio="1"
- Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"
- From="0"
- To="360"
- Duration="0:0:1" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </Path.Triggers>
- </Path>
- </Viewbox>
- </Grid>
- <Button
- Width="42"
- Height="42"
- Margin="20,0,0,0"
- VerticalAlignment="Center"
- hc:IconElement.Geometry="{StaticResource LayoutGeometry}"
- Background="{StaticResource TitleBackColor}"
- Cursor="Hand"
- IsEnabled="{Binding LayoutVisibily}">
- <Button.Style>
- <Style TargetType="Button" BasedOn="{StaticResource ImageButton}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.ShakerManger}">
- <Setter Property="Visibility" Value="Visible" />
- </DataTrigger>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.ConfigManger}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.DataManger}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.LogManger}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- <DataTrigger Binding="{Binding CurrentMainPage.MainPageType}" Value="{x:Static data:MainPageType.WarnManger}">
- <Setter Property="Visibility" Value="Collapsed" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Click">
- <hc:SetPropertyAction
- PropertyName="IsOpen"
- PropertyValue="{x:Static system:Boolean.TrueString}"
- TargetObject="{Binding LayoutManger}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </Button>
- <Button
- Width="42"
- Height="42"
- Margin="20,0,0,0"
- VerticalAlignment="Center"
- hc:IconElement.Geometry="{StaticResource CloseGeometry}"
- Background="{StaticResource TitleBackColor}"
- Command="{Binding ExitCommand}"
- Cursor="Hand"
- Style="{StaticResource ImageButton}"
- ToolTip="关闭" />
- </StackPanel>
- </Grid>
- </Border>
- <ContentControl
- Grid.Row="1"
- Grid.ColumnSpan="2"
- Margin="4,0,4,0"
- Content="{Binding CurrentMainPage.View, Converter={StaticResource Type2ViewConverter}}"
- IsEnabled="{Binding IsEnabled}" />
- <Popup
- AllowsTransparency="True"
- IsOpen="{Binding LayoutManger.IsOpen}"
- Placement="Mouse"
- PopupAnimation="Slide"
- StaysOpen="False">
- <ContentControl Content="{Binding LayoutManger.View, Converter={StaticResource Type2ViewConverter}}" />
- </Popup>
- <Popup
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2"
- AllowsTransparency="True"
- IsOpen="{Binding Source={StaticResource MainViewModel}, Path=Data.Shakers.SelectedIsOpen}"
- Placement="Mouse"
- PopupAnimation="Slide"
- StaysOpen="False">
- <view:ShakerSelectView DataContext="{Binding Source={StaticResource MainViewModel}, Path=Data.Shakers}" />
- </Popup>
- <Popup
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2"
- AllowsTransparency="True"
- IsOpen="{Binding Source={StaticResource ColorPicker}, Path=IsOpen}"
- Placement="Mouse"
- PopupAnimation="Slide"
- StaysOpen="True">
- <view:ColorPickerView DataContext="{Binding Source={StaticResource ColorPicker}}" />
- </Popup>
- <hc:Drawer
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2"
- Dock="Top"
- IsOpen="{Binding Source={StaticResource MainViewModel}, Path=Data.SystemConfig.UserPage.ResetPassWord.IsOpen}">
- <view:ResetPassWordView />
- </hc:Drawer>
- <hc:Drawer
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2"
- Dock="Top"
- IsOpen="{Binding Source={StaticResource MainViewModel}, Path=Data.SystemConfig.UserPage.AddUserViewModel.IsOpen}">
- <view:AddUserView />
- </hc:Drawer>
- <hc:Drawer
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2"
- Dock="Top"
- IsOpen="{Binding Source={x:Static vm:ProgressViewModel.Default}, Path=IsOpen}">
- <Border
- Width="{x:Static SystemParameters.PrimaryScreenWidth}"
- Height="{x:Static SystemParameters.PrimaryScreenHeight}"
- Background="#9FAAAAAA">
- <view:ProgressView />
- </Border>
- </hc:Drawer>
- <hc:Drawer
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2"
- DataContext="{Binding Source={StaticResource Prompt}, Path=Data}"
- Dock="Top"
- IsOpen="{Binding IsOpen}">
- <Border
- Width="{x:Static SystemParameters.PrimaryScreenWidth}"
- Height="{x:Static SystemParameters.PrimaryScreenHeight}"
- Background="#9FAAAAAA">
- <Border
- Width="560"
- Height="340"
- Background="Gray"
- CornerRadius="6">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="66" />
- <RowDefinition Height="2*" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border
- Grid.ColumnSpan="2"
- Background="{StaticResource ButtonNomalColor}"
- CornerRadius="6,6,0,0">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="32"
- FontWeight="Bold"
- Foreground="White"
- Text="{Binding Title}" />
- </Border>
- <StackPanel
- Grid.Row="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <Viewbox
- Grid.Row="1"
- Grid.Column="0"
- Width="60"
- Height="60"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Visibility="{Binding IconVisibility}">
- <Path Data="{Binding IconGeometry, Mode=OneWay}" Fill="{Binding IconBrush}" />
- </Viewbox>
- <TextBlock
- Grid.Row="1"
- Grid.Column="1"
- MaxWidth="420"
- Margin="20"
- HorizontalAlignment="Left"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="White"
- Text="{Binding Message}"
- TextWrapping="Wrap" />
- </StackPanel>
- <StackPanel
- Grid.Row="2"
- Grid.ColumnSpan="2"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <Button
- Width="88"
- Height="38"
- Command="{Binding YesCommand}"
- Content="{Binding YesText}"
- Cursor="Hand"
- FontSize="16"
- ToolTip="{Binding YesText}"
- Visibility="{Binding YesVisibility}" />
- <Button
- Width="88"
- Height="38"
- Margin="40,0,0,0"
- Command="{Binding NoCommand}"
- Content="{Binding NoText}"
- Cursor="Hand"
- FontSize="16"
- ToolTip="{Binding NoText}"
- Visibility="{Binding NoVisibility}" />
- </StackPanel>
- </Grid>
- </Border>
- </Border>
- </hc:Drawer>
- <hc:Drawer
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2"
- Dock="Top"
- IsOpen="{Binding Source={StaticResource Login}, Path=Data.IsLoggedIn, Converter={StaticResource Boolean2BooleanReConverter}}">
- <Grid
- Width="{x:Static SystemParameters.PrimaryScreenWidth}"
- Height="{x:Static SystemParameters.PrimaryScreenHeight}"
- Background="#9FAAAAAA"
- DataContext="{Binding Source={StaticResource Login}, Path=Data}">
- <Grid Width="620" Height="440">
- <Border
- Background="White"
- BorderBrush="{StaticResource BorderBrush}"
- BorderThickness="1"
- CornerRadius="6">
- <Border.Effect>
- <BlurEffect
- KernelType="Box"
- Radius="1"
- RenderingBias="Quality" />
- </Border.Effect>
- </Border>
- <Grid
- Width="400"
- Height="420"
- Margin="10"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Grid.RowDefinitions>
- <RowDefinition Height="100" />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition Height="32" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="42"
- Foreground="{StaticResource TitleBrush}"
- Text="用户登录" />
- <StackPanel
- Grid.Row="1"
- Height="42"
- Orientation="Horizontal">
- <TextBlock
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16"
- Text="用户名:" />
- <hc:WatermarkTextBox
- Width="320"
- Height="32"
- Margin="10,0,0,0"
- VerticalAlignment="Center"
- VerticalContentAlignment="Center"
- hc:BorderElement.CornerRadius="4"
- BorderBrush="{StaticResource BorderBrush}"
- BorderThickness="1"
- CaretBrush="Black"
- FontSize="16"
- Foreground="Black"
- InputScope="AlphanumericHalfWidth"
- MaxLength="20"
- Text="{Binding UserName}"
- Watermark="输入用户名" />
- </StackPanel>
- <StackPanel
- Grid.Row="2"
- Height="42"
- Orientation="Horizontal">
- <TextBlock
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- FontSize="16"
- Text=" 密码:" />
- <hc:PasswordBox
- Width="320"
- Height="32"
- Margin="10,0,0,0"
- VerticalAlignment="Center"
- VerticalContentAlignment="Center"
- hc:InfoElement.Placeholder="输入密码"
- Background="Transparent"
- BorderBrush="{StaticResource BorderBrush}"
- BorderThickness="1"
- CaretBrush="Black"
- FontSize="16"
- Foreground="Black"
- IsSafeEnabled="False"
- MaxLength="20"
- ShowEyeButton="True"
- UnsafePassword="{Binding PassWord}">
- <hc:PasswordBox.InputBindings>
- <KeyBinding Key="Enter" Command="{Binding LoginCommand}" />
- </hc:PasswordBox.InputBindings>
- </hc:PasswordBox>
- </StackPanel>
- <TextBlock
- Grid.Row="3"
- Foreground="Red"
- Text="{Binding Message}" />
- <StackPanel
- Grid.Row="4"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <Button
- Width="120"
- Height="36"
- Command="{Binding LoginCommand}"
- Content="登录"
- Cursor="Hand"
- FontSize="16"
- Foreground="Black" />
- <Button
- Width="120"
- Height="36"
- Margin="40,0,0,0"
- Command="{Binding Source={StaticResource MainViewModel}, Path=Data.ShutDownCommand}"
- Content="退出"
- Cursor="Hand"
- FontSize="16"
- Foreground="Black" />
- </StackPanel>
- </Grid>
- </Grid>
- <Button
- Margin="0,0,10,10"
- HorizontalAlignment="Right"
- VerticalAlignment="Bottom"
- BorderThickness="0"
- Command="{Binding Source={StaticResource Login}, Path=Data.AnonymousLoginCommand}"
- Content="匿名登录"
- FontSize="22"
- Foreground="Blue"
- ToolTip="匿名登录">
- <Button.Style>
- <Style TargetType="{x:Type Button}">
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type Button}">
- <TextBlock
- x:Name="text"
- Text="{TemplateBinding Content}"
- TextDecorations="Underline" />
- <ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="text" Property="Foreground" Value="Red" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Button.Style>
- </Button>
- </Grid>
- </hc:Drawer>
- <hc:Drawer
- Grid.Row="0"
- Grid.RowSpan="2"
- Grid.ColumnSpan="2"
- Dock="Top"
- IsOpen="{Binding Source={StaticResource DeviceControl}, Path=Data}">
- <Grid
- Width="{x:Static SystemParameters.PrimaryScreenWidth}"
- Height="{x:Static SystemParameters.PrimaryScreenHeight}"
- Background="#9FAAAAAA">
- <Border
- Width="1220"
- Height="760"
- Background="{StaticResource SystemItemsSelectBackColor}"
- CornerRadius="6,6,0,0">
- <Grid>
- <Grid.Resources>
- <SolidColorBrush x:Key="forecolor" Color="White" />
- </Grid.Resources>
- <Grid.RowDefinitions>
- <RowDefinition Height="48" />
- <RowDefinition Height="auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Grid Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <GroupBox
- Grid.Row="0"
- Margin="4"
- hc:TitleElement.Background="Transparent"
- hc:TitleElement.MinHeight="36"
- Background="Transparent"
- FontSize="20"
- Foreground="White"
- Header="功放控制"
- Style="{StaticResource GroupBoxTab}">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="160" />
- <RowDefinition Height="100" />
- </Grid.RowDefinitions>
- <UniformGrid
- Grid.Column="0"
- Margin="0,10,0,0"
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- Rows="2">
- <StackPanel Orientation="Horizontal">
- <TextBlock
- VerticalAlignment="Center"
- FontSize="24"
- Foreground="{StaticResource forecolor}"
- Text="增益" />
- <Slider
- Width="440"
- Height="48"
- Margin="10,0,0,0"
- hc:BorderElement.CornerRadius="6,0,0,6"
- Background="Green"
- FontSize="24"
- Foreground="{StaticResource forecolor}"
- IsMoveToPointEnabled="True"
- IsSnapToTickEnabled="True"
- Maximum="100"
- Minimum="0"
- Style="{DynamicResource InputElementBaseStyle}"
- Template="{DynamicResource SliderStyle}"
- Value="{Binding Shakers.Gain}" />
- </StackPanel>
- <StackPanel
- Margin="0,20,0,0"
- HorizontalAlignment="Center"
- Orientation="Horizontal">
- <Button
- Width="180"
- Height="48"
- Command="{Binding Shakers.OpenCommand}"
- Content="打开"
- FontSize="14"
- Foreground="{StaticResource forecolor}"
- ToolTip="打开增益" />
- <Button
- Width="180"
- Height="48"
- Margin="80,0,0,0"
- Command="{Binding Shakers.CloseCommand}"
- Content="关闭"
- FontSize="14"
- Foreground="{StaticResource forecolor}"
- ToolTip="关闭增益" />
- </StackPanel>
- </UniformGrid>
- <UniformGrid Grid.Row="1" Columns="3">
- <UniformGrid.Resources>
- <system:Double x:Key="size">72</system:Double>
- </UniformGrid.Resources>
- <Button
- Width="{StaticResource size}"
- Height="{StaticResource size}"
- hc:IconElement.Geometry="{StaticResource StartGeometry}"
- Command="{Binding Shakers.StartCommand}"
- Foreground="{StaticResource forecolor}"
- Style="{StaticResource ImageButton}"
- ToolTip="打开功放" />
- <Button
- Width="{StaticResource size}"
- Height="{StaticResource size}"
- hc:IconElement.Geometry="{StaticResource StopGeometry}"
- Command="{Binding Shakers.StopCommand}"
- Foreground="{StaticResource forecolor}"
- Style="{StaticResource ImageButton}"
- ToolTip="关闭功放" />
- <Button
- Width="{StaticResource size}"
- Height="{StaticResource size}"
- hc:IconElement.Geometry="{StaticResource ResetGeometry}"
- Command="{Binding Shakers.ResetCommand}"
- Foreground="{StaticResource forecolor}"
- Style="{StaticResource ImageButton}"
- ToolTip="重置功放错误" />
- </UniformGrid>
- </Grid>
- </GroupBox>
- <GroupBox
- Grid.Column="1"
- Margin="4"
- hc:TitleElement.Background="Transparent"
- hc:TitleElement.MinHeight="36"
- Background="Transparent"
- FontSize="20"
- Foreground="White"
- Header="冷却单元控制"
- Style="{StaticResource GroupBoxTab}">
- <UniformGrid
- Grid.Row="1"
- Height="140"
- Columns="3">
- <UniformGrid.Resources>
- <system:Double x:Key="size">72</system:Double>
- </UniformGrid.Resources>
- <Button
- Width="{StaticResource size}"
- Height="{StaticResource size}"
- hc:IconElement.Geometry="{StaticResource StartGeometry}"
- Command="{Binding Shakers.CoolingWaterStartCommand}"
- Foreground="{StaticResource forecolor}"
- Style="{StaticResource ImageButton}"
- ToolTip="打开冷却单元" />
- <Button
- Width="{StaticResource size}"
- Height="{StaticResource size}"
- hc:IconElement.Geometry="{StaticResource StopGeometry}"
- Command="{Binding Shakers.CoolingWaterStopCommand}"
- Foreground="{StaticResource forecolor}"
- Style="{StaticResource ImageButton}"
- ToolTip="关闭冷却单元" />
- <Button
- Width="{StaticResource size}"
- Height="{StaticResource size}"
- hc:IconElement.Geometry="{StaticResource ResetGeometry}"
- Command="{Binding Shakers.CoolingWaterResetCommand}"
- Foreground="{StaticResource forecolor}"
- Style="{StaticResource ImageButton}"
- ToolTip="重置冷却单元错误" />
- </UniformGrid>
- </GroupBox>
- </Grid>
- <Border Background="{StaticResource ButtonNomalColor}" CornerRadius="6,6,0,0">
- <Grid>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="22"
- Foreground="{StaticResource SystemItemsForeColor}"
- Text="设备控制" />
- <Button
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- hc:IconElement.Geometry="{StaticResource CloseGeometry}"
- Style="{StaticResource ImageButton}"
- ToolTip="关闭">
- <hc:Interaction.Triggers>
- <hc:EventTrigger EventName="Click">
- <hc:SetPropertyAction
- PropertyName="Data"
- PropertyValue="{x:Static system:Boolean.FalseString}"
- TargetObject="{Binding Source={StaticResource DeviceControl}}" />
- </hc:EventTrigger>
- </hc:Interaction.Triggers>
- </Button>
- </Grid>
- </Border>
- <Border
- Grid.Row="2"
- Margin="10,0,10,10"
- BorderBrush="Gray"
- BorderThickness="1"
- CornerRadius="6,6,0,0">
- <ListView
- Foreground="{StaticResource NomalForeColor}"
- ItemsSource="{Binding Shakers.Shakers}"
- TextBlock.FontSize="14">
- <ListView.Style>
- <Style TargetType="ListView" BasedOn="{x:Null}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="VerticalContentAlignment" Value="Stretch" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListView">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="42" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <Border Background="{StaticResource ButtonNomalColor}" CornerRadius="6,6,0,0">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="66" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="启用" />
- <TextBlock
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="振动台" />
- </Grid>
- </Border>
- <hc:ScrollViewer
- Grid.Row="1"
- HorizontalScrollBarVisibility="Hidden"
- VerticalScrollBarVisibility="Auto">
- <ItemsPresenter Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </hc:ScrollViewer>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemTemplate">
- <Setter.Value>
- <DataTemplate>
- <Grid IsEnabled="{Binding IsConnected}">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="66" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <CheckBox
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- IsChecked="{Binding IsDeviceControl}" />
- <TextBlock
- Grid.Column="1"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Text="{Binding Description}" />
- </Grid>
- </DataTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemContainerStyle">
- <Setter.Value>
- <Style TargetType="ListViewItem">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="Height" Value="42" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="OverridesDefaultStyle" Value="True" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="IsEnabled" Value="True" />
- <Setter Property="Padding" Value="0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ListViewItem">
- <ContentPresenter
- Margin="0,0,0,0"
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- ContentTemplateSelector="{x:Null}"
- IsEnabled="{Binding Source={x:Static vm:LoginViewModel.Default}, Path=IsAnonymous, Converter={StaticResource Boolean2BooleanReConverter}}" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Setter.Value>
- </Setter>
- <Setter Property="ItemsPanel">
- <Setter.Value>
- <ItemsPanelTemplate>
- <UniformGrid
- Margin="0"
- Columns="1"
- Style="{x:Null}" />
- </ItemsPanelTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ListView.Style>
- </ListView>
- </Border>
- </Grid>
- </Border>
- </Grid>
- </hc:Drawer>
- </Grid>
- </Viewbox>
- </Window>
|