Newer
Older
Correlator / PipeGallery / View / SelectPipeMaterialView.xaml
<UserControl
    x:Class="PipeGallery.View.SelectPipeMaterialView"
    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"
    d:DesignHeight="768"
    d:DesignWidth="1366"
    Background="#b4000000"
    mc:Ignorable="d">
    <Grid>
        <Viewbox>
            <Grid Width="1366" Height="768">
                <Border
                    Width="860"
                    Height="560"
                    Margin="253,104"
                    Background="White"
                    CornerRadius="10">
                    <Grid Margin="10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="*" />
                            <RowDefinition Height="7*" />
                        </Grid.RowDefinitions>
                        <Grid>
                            <StackPanel Margin="0,0,0,0" Orientation="Horizontal">
                                <Button
                                    x:Name="btnReturn"
                                    Margin="10,0,20,0"
                                    Style="{StaticResource BtnReturnStyle}" />
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="1.1*" />
                                        <RowDefinition Height="0.9*" />
                                    </Grid.RowDefinitions>
                                    <TextBlock
                                        VerticalAlignment="Bottom"
                                        FontSize="24"
                                        Foreground="#6c6c6c"
                                        Text="选择管道材质" />
                                    <TextBlock
                                        Grid.Row="1"
                                        VerticalAlignment="Top"
                                        FontSize="14"
                                        Foreground="#bcbcbc"
                                        Text="Selection of pipe material" />
                                </Grid>
                                <TextBlock
                                    Name="txtPipeLine"
                                    VerticalAlignment="Center"
                                    FontSize="20"
                                    Foreground="#666666"
                                    Text="" />
                            </StackPanel>
                            <StackPanel
                                Margin="20,0,0,0"
                                HorizontalAlignment="Right"
                                Orientation="Horizontal">
                                <Button
                                    x:Name="btnDefault"
                                    Width="110"
                                    Margin="10,0"
                                    Content="还原默认值"
                                    Style="{StaticResource BtnCommonStyle}"
                                    Visibility="Collapsed">
                                    <Button.Background>
                                        <ImageBrush ImageSource="/PipeGallery;component/Image/tubiao_45.png" />
                                    </Button.Background>
                                    <Button.Tag>
                                        <ImageBrush ImageSource="/PipeGallery;component/Image/tubiao_15.png" />
                                    </Button.Tag>
                                </Button>
                                <Button
                                    x:Name="btnEditSoundSpeed"
                                    Width="100"
                                    Margin="10,0"
                                    Content="编辑声速"
                                    IsEnabled="{Binding ElementName=btnEditName, Path=IsEnabled}"
                                    Style="{StaticResource BtnCommonStyle6}">
                                    <Button.Background>
                                        <ImageBrush ImageSource="/PipeGallery;component/Image/tubiao_09.png" />
                                    </Button.Background>
                                    <Button.Tag>
                                        <ImageBrush ImageSource="/PipeGallery;component/Image/tubiao_42.png" />
                                    </Button.Tag>
                                </Button>
                                <Button
                                    x:Name="btnEditName"
                                    Width="100"
                                    Margin="10,0"
                                    Content="编辑名称"
                                    IsEnabled="False"
                                    Style="{StaticResource BtnCommonStyle6}">
                                    <Button.Background>
                                        <ImageBrush ImageSource="/PipeGallery;component/Image/tubiao_11.png" />
                                    </Button.Background>
                                    <Button.Tag>
                                        <ImageBrush ImageSource="/PipeGallery;component/Image/tubiao_43.png" />
                                    </Button.Tag>
                                </Button>
                            </StackPanel>
                        </Grid>
                        <Grid Grid.Row="1">
                            <ListBox
                                Margin="0,20"
                                ItemContainerStyle="{StaticResource ListBoxItemStyle}"
                                ItemsSource="{Binding PipeMaterialInfos}">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <Border
                                            x:Name="bdrMain"
                                            Width="194"
                                            Height="107"
                                            Background="Transparent"
                                            BorderBrush="Transparent">
                                            <RadioButton
                                                x:Name="rb"
                                                Margin="0,0,0,0"
                                                HorizontalAlignment="Center"
                                                VerticalAlignment="Center"
                                                Click="rb_Click"
                                                Content="{Binding Name}"
                                                DataContext="{Binding}"
                                                FontSize="20"
                                                GroupName="pipe"
                                                IsChecked="{Binding Path=IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                MouseDoubleClick="rb_MouseDoubleClick"
                                                Style="{StaticResource RadioButtonStyle2}"
                                                Tag="{Binding Name2}" />
                                        </Border>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                                <ListBox.Template>
                                    <ControlTemplate TargetType="{x:Type ListBox}">
                                        <Grid VerticalAlignment="Top" Background="Transparent">
                                            <ScrollViewer HorizontalScrollBarVisibility="Hidden">
                                                <WrapPanel
                                                    Width="780"
                                                    HorizontalAlignment="Center"
                                                    IsItemsHost="True" />
                                            </ScrollViewer>
                                        </Grid>
                                    </ControlTemplate>
                                </ListBox.Template>
                            </ListBox>
                        </Grid>
                    </Grid>
                </Border>
            </Grid>
        </Viewbox>
    </Grid>
</UserControl>