UcFeeder.xaml 4.46 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
<UserControl x:Class="FLY.DownBlowing.UI.Client.UiModule.UcFeeder"
             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:local="clr-namespace:FLY.DownBlowing.UI.Client.UiModule" 
             xmlns:flyctrl="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary" 
             xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
             xmlns:i="http://schemas.microsoft.com/xaml/behaviors" 
             xmlns:ut="clr-namespace:FLY.DownBlowing.UI.Client.UnitTests"             
             mc:Ignorable="d"  >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="FeederPanelStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid d:DataContext="{Binding Source={StaticResource downBlowingSystemUt},Path=FeederDatas[0]}">
        <Border Style="{StaticResource Styles.Module.Border}" Background="{StaticResource Color_background}">
            <Viewbox Margin="{StaticResource ControlMargin}" Stretch="Uniform" StretchDirection="DownOnly" HorizontalAlignment="Left" VerticalAlignment="Top">
                <Grid >
                <StackPanel>
                    <Border Width="100" Background="{StaticResource Color_badgeBg}" Margin="3" HorizontalAlignment="Left">
                        <TextBlock Text="{Binding Number}" Width="100" Height="100" FontSize="100" FontWeight="Bold" FontFamily="Arial Black" Foreground="{StaticResource Color_badgeText}" VerticalAlignment="Top" HorizontalAlignment="Left"/>
                    </Border>
                    <ItemsControl ItemsSource="{Binding Feeders}">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel/>
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="{StaticResource ControlMargin}">
                                    <Grid>
                                        <flyctrl:ToggleButtonOnOff Style="{StaticResource ToggleButtonOnOffStyle}" Width="140"
                                                                   Margin="{StaticResource ControlMargin}" 
                                                                    OnLabel="吸料开" OnBrush="{StaticResource Color_on}"
                                                                    OffLabel="吸料关" OffBrush="{StaticResource Color_off}"
                                                                    IsChecked="{Binding IsFeederOn}"/>
                                        <TextBlock HorizontalAlignment="Right" VerticalAlignment="Top" Padding="6,2" Margin="0,-5,-5,0"
                                   Background="{StaticResource Color_badgeBg}" Foreground="{StaticResource Color_badgeText}" 
                                   FontSize="30"
                                   Text="{Binding Number}" />
                                    </Grid>
                                    <Grid Width="20"/>
                                    <Button Style="{StaticResource MahApps.Styles.Button.Square.Accent}" 
                                Padding="20,5" Margin="{StaticResource ControlMargin}"
                                FontSize="{StaticResource FontSize_title}" 
                                Content="复位" 
                                            Visibility="{Binding IsFeederResetValid,Converter={StaticResource visbilityconv}}">
                                        <i:Interaction.Behaviors>
                                            <flyctrl:Set1Behavior Binding="{Binding FeederReset}"/>
                                        </i:Interaction.Behaviors>
                                    </Button>
                                </StackPanel>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>

                </StackPanel>
            </Grid>
            </Viewbox>
        </Border>
    </Grid>
</UserControl>