DynAreaThick.xaml 3.66 KB
Newer Older
1
<UserControl x:Class="FLY.Thick.Blowing.UI.UiModule.DynAreaThick"
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" 
6 7
             xmlns:local="clr-namespace:FLY.Thick.Blowing.UI.UiModule"
             xmlns:common="clr-namespace:FLY.Thick.Base.Common;assembly=FLY.Thick.Base"
8 9 10 11 12 13 14
             mc:Ignorable="d" d:DesignWidth="250">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Themes/Dictionary_MyStyle.xaml"/>
                <ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Converter/Dictionary_MyConv.xaml"/>
            </ResourceDictionary.MergedDictionaries>
15
            <common:DynArea x:Key="dynArea"/>
16 17
        </ResourceDictionary>
    </UserControl.Resources>
18 19
    <Button Style="{StaticResource Styles.Button.Empty}" d:DataContext="{StaticResource dynArea}">
        <Border Style="{StaticResource Styles.Module.Border}" >
20 21 22 23 24
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition  />
                    <RowDefinition Height="auto" />
                </Grid.RowDefinitions>
25
                <Border Background="{StaticResource Brushes.Activity}" CornerRadius="3" Height="130" >
26 27
                    <Grid>
                        <Viewbox Margin="10">
28 29 30
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" 
                                       Foreground="{StaticResource Brushes.TitleBar.Foreground}" 
                                       TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" 
31
                                       Text="{Binding Thk,StringFormat={}{0:F2}}" />
32
                        </Viewbox>
33 34 35 36 37
                        <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue.Unit}" 
                                   Foreground="{StaticResource Brushes.TitleBar.Foreground}" 
                                   HorizontalAlignment="Right" VerticalAlignment="Bottom" 
                                   Margin="{StaticResource ControlMargin}"
                                   Text="{Binding ControllerState}" />
38 39 40 41 42 43 44 45 46 47 48 49 50 51
                    </Grid>
                </Border>
                <StackPanel Grid.Row="1" Margin="2">
                    <Grid Margin="2" Name="grid_ad">
                        <Rectangle Fill="#FF86C2E9" HorizontalAlignment="Left">
                            <Rectangle.Width>
                                <MultiBinding Converter="{StaticResource ratioconv}" Mode="OneWay">
                                    <Binding Path="AD" />
                                    <Binding Path="ADMax" />
                                    <Binding Path="ActualWidth" ElementName="grid_ad"/>
                                </MultiBinding>
                            </Rectangle.Width>
                        </Rectangle>
                        <StackPanel Orientation="Horizontal">
52 53 54 55
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemHeader}" 
                                       Text="AD" />
                            <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" 
                                       Text="{Binding AD}" />
56 57 58 59 60 61 62
                        </StackPanel>
                    </Grid>
                </StackPanel>
            </Grid>
        </Border>
    </Button>
</UserControl>