Window_RatioSet.xaml 5.02 KB
<flyctrllib:WindowBigClose x:Class="FLY.Weight.UI.Client.Window_RatioSet"
        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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:FLY.Weight.UI.Client"
        xmlns:control="clr-namespace:FLY.Weight.UI.Client.Control"
        xmlns:flyctrllib="clr-namespace:FLY.ControlLibrary;assembly=FLY.ControlLibrary"
        mc:Ignorable="d"
        Title="Window_RatioSet" WindowStartupLocation="CenterScreen" d:DesignWidth="538.195" Loaded="WindowBigClose_Loaded" d:DesignHeight="525.559">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.Weight.UI.Client;component/Themes/LightSkin.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.Weight.UI.Client;component/UnitTests/UnitTests_Weights.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.Weight.UI.Client;component/Themes/Dictionary_MainSingleWeight.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <StackPanel Name="root_grid" Orientation="Vertical" Margin="5,20" >
        <StackPanel.DataContext>
            <StaticResource ResourceKey="unittests_weighters"/>
        </StackPanel.DataContext>
        <StackPanel Orientation="Vertical" Margin="5">
            <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeader}" Text="流量设置" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="44" />
        </StackPanel>
        <Grid >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="auto"/>
                <ColumnDefinition Width="auto"/>
            </Grid.ColumnDefinitions>
            <ItemsControl Grid.Row="1" ItemsSource="{Binding Items}">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <StackPanel Orientation="Vertical" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Horizontal">
                            <Grid x:Name="templateRoot" SnapsToDevicePixels="true" Margin="10,0">
                                <Border x:Name="mainBorder" MinWidth="60" Height="60" Background="{Binding Color}" Margin="0" />
                                <TextBlock Text="{Binding Number}" FontSize="60" Foreground="White" FontWeight="Bold"  VerticalAlignment="Bottom" HorizontalAlignment="Left"  />
                            </Grid>
                            <Border Background="{Binding Color}" Margin="3" >
                                <Border BorderThickness="1" BorderBrush="White" Margin="3" MinWidth="160">
                                    <StackPanel Orientation="Horizontal" Margin="20,3" HorizontalAlignment="Center" VerticalAlignment="Center">
                                        <TextBox Style="{StaticResource TextBoxStyle_FieldContent}" Text="{Binding ScrewPSet, StringFormat={}{0:F1}}" Background="Transparent" Foreground="White"/>
                                        <TextBlock Style="{StaticResource TextBlockStyle_FieldContent_mm}" Text="%" Foreground="White" />
                                    </StackPanel>
                                </Border>
                            </Border>
                        </StackPanel>

                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
            <StackPanel Orientation="Vertical" Grid.Column="1">
                <control:PieChart x:Name="piechart" Width="200" Height="200" Margin="10" 
                                  ItemValueBinding="ScrewPSet" ItemColorBinding="Color"
                                  ItemsSource="{Binding Items}" 
                                  />
                <StackPanel Orientation="Vertical" Margin="5">
                    <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldHeaderEditable}" Text="总流量" />
                    <StackPanel Orientation="Horizontal">
                        <TextBox Style="{StaticResource ResourceKey=TextBoxStyle_FieldContent}" Text="{Binding Accessory.TotalFlowSetting, StringFormat={}{0:F1}}"/>
                        <TextBlock Style="{StaticResource ResourceKey=TextBlockStyle_FieldContent_mm}" Text="kg/h" />
                    </StackPanel>
                </StackPanel>
                <Button Style="{StaticResource ButtonStyle2}" Content="当前->设置" FontSize="30" Width="auto" Margin="5" Click="button_autoset_Click"  />
            </StackPanel>
        </Grid>

    </StackPanel>

</flyctrllib:WindowBigClose>