DynAreaIbc.xaml 8.03 KB
Newer Older
潘栩锋's avatar
潘栩锋 committed
1
<UserControl x:Class="FLY.IBC.UI.Client.UiModule.DynAreaIbc"
潘栩锋's avatar
潘栩锋 committed
2 3 4 5
      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" 
潘栩锋's avatar
潘栩锋 committed
6
      xmlns:local="clr-namespace:FLY.IBC.UI.Client.UiModule"
潘栩锋's avatar
潘栩锋 committed
7
      mc:Ignorable="d" 
潘栩锋's avatar
潘栩锋 committed
8 9
      d:DesignWidth="292">
    <UserControl.Resources>
潘栩锋's avatar
潘栩锋 committed
10 11 12 13 14
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Dictionary_MyConv.xaml"/>

潘栩锋's avatar
潘栩锋 committed
15
                <ResourceDictionary Source="pack://application:,,,/FLY.IBC.UI.Client;component/Themes/Styles.xaml"/>
潘栩锋's avatar
潘栩锋 committed
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
                <ResourceDictionary Source="pack://application:,,,/FLY.IBC.UI.Client;component/UnitTests/UnitTests_ibc.xaml"/>

            </ResourceDictionary.MergedDictionaries>


            <Style TargetType="{x:Type Path}" x:Key="PathStyle_icon">
                <Setter Property="Fill" Value="White"/>
                <Setter Property="Stretch" Value="Uniform"/>
                <Setter Property="Width" Value="30"/>
                <Setter Property="Height" Value="30"/>
                <Setter Property="SnapsToDevicePixels" Value="True"/>
            </Style>

            <local:DynAreaViewModelParams x:Key="unitests_props" IsError="False" Error="报警MSG"/>
        </ResourceDictionary>
潘栩锋's avatar
潘栩锋 committed
31
    </UserControl.Resources>
潘栩锋's avatar
潘栩锋 committed
32 33 34 35 36 37 38
    
    <Button Style="{StaticResource ButtonStyle_empty}" Background="Transparent" Click="Button_Click">
        <Grid>
            <Grid x:Name="grid_ibc" d:DataContext="{StaticResource unitests_ibc}"/>
            <Grid x:Name="grid_error" d:DataContext="{StaticResource unitests_props}"/>

            <Border Style="{StaticResource BorderStyle_module}" 
潘栩锋's avatar
潘栩锋 committed
39 40
                    DataContext="{Binding DataContext,ElementName=grid_ibc}"
                    Background="{StaticResource Color_background}">
潘栩锋's avatar
潘栩锋 committed
41 42 43 44 45 46 47 48 49 50
                <StackPanel Orientation="Vertical" >
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <TextBlock Text="折径" Style="{StaticResource TextBlockStyle_title}" Margin="2"/>

                        <Viewbox Grid.Column="1" Grid.Row="1"  MaxHeight="80" HorizontalAlignment="Left">
                            <StackPanel Orientation="Horizontal">
潘栩锋's avatar
潘栩锋 committed
51

潘栩锋's avatar
潘栩锋 committed
52
                                <TextBlock Margin="4" >
潘栩锋's avatar
潘栩锋 committed
53 54
                                    <Run Text="{Binding FilmWidth,StringFormat={}{0:F0}}" Style="{StaticResource RunStyle_text}" FontSize="50" />
                                    <Run Text="mm" Style="{StaticResource RunStyle_unit}"/>
潘栩锋's avatar
潘栩锋 committed
55 56 57 58 59 60 61 62 63 64 65
                                </TextBlock>
                            </StackPanel>
                        </Viewbox>

                    </Grid>
                    <Grid Margin="2">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition/>
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <StackPanel Orientation="Horizontal" Margin="2" >
潘栩锋's avatar
潘栩锋 committed
66 67 68 69 70 71
                            <TextBlock Style="{StaticResource TextBlockStyle_title}" FontSize="12" 
                                       Text="进风" />
                            <TextBlock Margin="5,0">
                                <Run Text="{Binding InletAirFreq,StringFormat={}{0:F1}}" Style="{StaticResource RunStyle_text}" FontSize="24" />
                                <Run Text="Hz" Style="{StaticResource RunStyle_unit}" FontSize="12"/>
                            </TextBlock>
潘栩锋's avatar
潘栩锋 committed
72 73 74 75 76 77 78 79 80 81 82 83
                            <StackPanel.Style>
                                <Style TargetType="StackPanel">
                                    <Setter Property="Background" Value="{StaticResource Color_theme_static}"/>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsInletAirOn}" Value="True">
                                            <Setter Property="Background" Value="{StaticResource Color_theme_activity}"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </StackPanel.Style>
                        </StackPanel>
                        <StackPanel Grid.Column="1"  Orientation="Horizontal" Margin="2" >
潘栩锋's avatar
潘栩锋 committed
84 85 86 87 88 89
                            <TextBlock Style="{StaticResource TextBlockStyle_title}" FontSize="12" 
                                       Text="出风" />
                            <TextBlock Margin="5,0">
                                <Run Text="{Binding OutletAirFreq,StringFormat={}{0:F1}}" Style="{StaticResource RunStyle_text}" FontSize="24" />
                                <Run Text="Hz" Style="{StaticResource RunStyle_unit}" FontSize="12"/>
                            </TextBlock>
潘栩锋's avatar
潘栩锋 committed
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137
                            <StackPanel.Style>
                                <Style TargetType="StackPanel">
                                    <Setter Property="Background" Value="{StaticResource Color_theme_static}"/>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding IsOutletAirOn}" Value="True">
                                            <Setter Property="Background" Value="{StaticResource Color_theme_activity}"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </StackPanel.Style>
                        </StackPanel>
                    </Grid>
                </StackPanel>
            </Border>

            <Border Style="{StaticResource BorderStyle_module}" Background="Red" 
                    DataContext="{Binding DataContext,ElementName=grid_error}"
                    Visibility="{Binding IsError,Converter={StaticResource visbilityconv}}">
                <Grid >
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="auto"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Path Margin="5" Fill="White" Stretch="Uniform" Width="60" Height="60" SnapsToDevicePixels="True" Data="{StaticResource Geometry_alert-circle-outline}"  >
                        <Path.Style>
                            <Style TargetType="Path">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsError}" Value="True">
                                        <DataTrigger.EnterActions>
                                            <BeginStoryboard>
                                                <Storyboard RepeatBehavior="Forever" >
                                                    <DoubleAnimation BeginTime="0:0:0" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="00:00:01" />
                                                    <DoubleAnimation BeginTime="0:0:1" Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="00:00:01" />
                                                </Storyboard>
                                            </BeginStoryboard>
                                        </DataTrigger.EnterActions>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </Path.Style>
                    </Path>
                    <TextBlock Grid.Column="1" Margin="5" VerticalAlignment="Center" TextWrapping="Wrap" FontSize="30" Foreground="White" Text="{Binding Error}"/>
                </Grid>

            </Border>
            
        </Grid>
    </Button>
潘栩锋's avatar
潘栩锋 committed
138
</UserControl>