|
- <UserControl
- x:Class="BPASmartClient.FoodStationTest.View.DeviceListView"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:control="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BPASmartClient.FoodStationTest.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:pry="clr-namespace:BPASmartClient.CustomResource.UserControls;assembly=BPASmartClient.CustomResource"
- xmlns:vm="clr-namespace:BPASmartClient.FoodStationTest.ViewModel"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
-
- <UserControl.DataContext>
- <vm:DeviceListViewModel />
- </UserControl.DataContext>
-
- <UserControl.Resources>
- <Style x:Key="UserItemContainerStyle" TargetType="ListBoxItem">
- <Style.Resources>
- <!-- SelectedItem with focus -->
- <SolidColorBrush
- x:Key="{x:Static SystemColors.HighlightBrushKey}"
- Opacity=".4"
- Color="White" />
- <!-- SelectedItem without focus -->
- <SolidColorBrush
- x:Key="{x:Static SystemColors.ControlBrushKey}"
- Opacity=".4"
- Color="White" />
- </Style.Resources>
- <!-- 设置触发器 -->
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter Property="Background" Value="White" />
- <Setter Property="Foreground" Value="White" />
- </Trigger>
- <Trigger Property="IsFocused" Value="true">
- <Setter Property="Background" Value="White" />
- <Setter Property="Foreground" Value="White" />
- </Trigger>
- </Style.Triggers>
- </Style>
- </UserControl.Resources>
-
- <Grid Margin="-5,0,5,0">
-
- <Grid>
- <ListView
- Grid.Column="1"
- Margin="10"
- Background="Transparent"
- BorderBrush="#00BEFA"
- BorderThickness="0"
- ItemsSource="{Binding devices}"
- ScrollViewer.HorizontalScrollBarVisibility="Disabled">
- <ListView.ItemsPanel>
- <ItemsPanelTemplate>
- <!--<UniformGrid
- HorizontalAlignment="Left"
- VerticalAlignment="Top"
- Columns="8" />-->
- <WrapPanel Orientation="Horizontal" />
- </ItemsPanelTemplate>
- </ListView.ItemsPanel>
-
- <ListView.ItemTemplate>
- <DataTemplate>
- <Border
- Name="ShadowElement"
- Width="180"
- Height="150"
- Margin="10"
- VerticalAlignment="Top"
- BorderBrush="#00BEFA"
- BorderThickness="0"
- ClipToBounds="True"
- CornerRadius="0">
- <Border.Background>
- <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/蓝色背景.png" />
- </Border.Background>
-
- <Grid Margin="20,0,20,0">
-
- <!--<Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>-->
-
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- <RowDefinition />
- </Grid.RowDefinitions>
-
- <TextBlock
- Grid.Row="0"
- Grid.ColumnSpan="2"
- Margin="0,10,0,0"
- VerticalAlignment="Center"
- FontSize="20"
- Foreground="#00BEFA"
- Text="{Binding DeviceName}" />
-
- <StackPanel
- Grid.Row="1"
- VerticalAlignment="Center"
- Orientation="Horizontal">
- <TextBlock
- Grid.Row="1"
- FontSize="14"
- Foreground="#aa00BEFA"
- Text="设备IP:" />
- <TextBlock
- Grid.Row="1"
- FontSize="14"
- Foreground="#aa00BEFA"
- Text="{Binding IpAddress}" />
- </StackPanel>
-
- <Button
- Grid.Row="2"
- Width="130"
- Height="30"
- Margin="0,0,0,0"
- VerticalAlignment="Top"
- Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
- CommandParameter="{Binding IpAddress}"
- Content="修改原料名称"
- FontSize="16"
- IsEnabled="{Binding IsEnable}"
- Style="{StaticResource ImageButtonStyle}" />
-
- <WrapPanel Grid.Row="3">
- <Button
- Width="65"
- Height="30"
- Margin="0,0,0,0"
- VerticalAlignment="Top"
- Command="{Binding DataContext.Open, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
- CommandParameter="{Binding IpAddress}"
- Content="开盖"
- FontSize="16"
- IsEnabled="{Binding IsEnable}"
- Style="{StaticResource ImageButtonStyle}" />
- <Button
- Width="65"
- Height="30"
- Margin="10,0,0,0"
- VerticalAlignment="Top"
- Command="{Binding DataContext.Close, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
- CommandParameter="{Binding IpAddress}"
- Content="关盖"
- FontSize="16"
- IsEnabled="{Binding IsEnable}"
- Style="{StaticResource ImageButtonStyle}" />
- </WrapPanel>
-
-
- <!--<Button
- Grid.Row="1"
- Grid.Column="0"
- Grid.ColumnSpan="2"
- Foreground="#00BEFA"
- Width="130"
- Height="30"
- Margin="0,0,0,10"
- HorizontalAlignment="Left"
- VerticalAlignment="Bottom"
- Command="{Binding DataContext.ChangeNameCommand, RelativeSource={RelativeSource AncestorType=ListView, Mode=FindAncestor}}"
- CommandParameter="{Binding IpAddress}"
- Content="修改原料名称"
- IsEnabled="{Binding IsEnable}">
- <Button.Background>
- <ImageBrush ImageSource="/BPASmartClient.CustomResource;component/Image/系统名称.png" />
- </Button.Background>
- </Button>-->
-
-
- </Grid>
- </Border>
-
- </DataTemplate>
- </ListView.ItemTemplate>
- </ListView>
- </Grid>
- </Grid>
- </UserControl>
|