<UserControl x:Class="FLY.Thick.Base.UI.UiModule.DynAreaSample"
             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.Thick.Base.UI"
             d:DesignWidth="250"
             mc:Ignorable="d" >
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/FLY.ControlLibrary;component/Converter/Converters.xaml"/>
            </ResourceDictionary.MergedDictionaries>

            <local:PgGetSampleVmUt x:Key="viewModel" Enable="True"/>
        </ResourceDictionary>
    </UserControl.Resources>
    <Button d:DataContext="{StaticResource viewModel}"
        Style="{StaticResource Styles.Button.Empty}" Width="250" Click="Border_Sample_Click" 
            Visibility="{Binding Enable,Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}">
        <Border Style="{StaticResource Styles.Module.Border}" >
            <StackPanel Margin="2">
                <ItemsControl ItemsSource="{Binding Samples}">
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Grid Margin="2" Visibility="{Binding Enable,Converter={StaticResource visbilityconv},ConverterParameter=Collapsed}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="182*" />
                                    <ColumnDefinition Width="auto" />
                                </Grid.ColumnDefinitions>
                                <StackPanel Orientation="Horizontal" >
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemHeader}" >
                                        <Run Text="{StaticResource str.DynArea.Sample}" /><Run Text="{Binding Name}"/>
                                    </TextBlock>
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue}" Foreground="{StaticResource Brushes.Activity}"
                                               Text="{Binding AD}" />
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue.Separator}"/>
                                    <TextBlock Style="{StaticResource Styles.Module.Text.ItemValue.Unit}"
                                               Text="{Binding OrgAD}"  />
                                </StackPanel>
                                <TextBlock Grid.Column="1" 
                                           Style="{StaticResource Styles.Module.Text.ItemValue}"
                                           Background="{StaticResource Brushes.Activity}" Foreground="White"
                                           Text="{Binding SampleValue,StringFormat={}{0:F2}}"  />
                            </Grid>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
            </StackPanel>
        </Border>
    </Button>
</UserControl>
