123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <UserControl
- x:Class="ShakerManger.View.GPIOPageView"
- 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:hc="https://handyorg.github.io/handycontrol"
- xmlns:local="clr-namespace:ShakerManger.View"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:ShakerManger.ViewModel"
- d:DataContext="{d:DesignInstance {x:Type vm:GPIOControlViewModel}}"
- d:DesignHeight="450"
- d:DesignWidth="800"
- DataContext="{Binding GPIOControl}"
- FontSize="14"
- mc:Ignorable="d">
- <Grid
- Width="420"
- HorizontalAlignment="Center"
- VerticalAlignment="Top">
- <Grid.RowDefinitions>
- <RowDefinition />
- <RowDefinition Height="66" />
- </Grid.RowDefinitions>
- <StackPanel
- HorizontalAlignment="Center"
- VerticalAlignment="Top"
- Orientation="Vertical">
- <StackPanel Height="66" Orientation="Horizontal">
- <TextBlock VerticalAlignment="Center" Text="扫描周期:" />
- <hc:NumericUpDown
- Width="220"
- Height="36"
- Margin="4,0,0,0"
- Background="Transparent"
- FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=FontFamily}"
- FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=FontSize}"
- Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=Foreground}"
- Increment="1"
- Minimum="10"
- Value="{Binding LoopTime}" />
- <TextBlock
- Margin="4,0,0,0"
- VerticalAlignment="Center"
- Text="ms" />
- </StackPanel>
- <StackPanel Height="66" Orientation="Horizontal">
- <TextBlock VerticalAlignment="Center" Text="GPIO端口:" />
- <ComboBox
- Width="220"
- Height="36"
- Margin="4,0,0,0"
- Background="Transparent"
- DisplayMemberPath="Key"
- FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=FontFamily}"
- FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=FontSize}"
- Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}, Path=Foreground}"
- ItemsSource="{Binding Pins, Mode=OneTime}"
- SelectedValue="{Binding PinIndex}"
- SelectedValuePath="Value"
- Style="{StaticResource ComboBoxStyle1}" />
- </StackPanel>
- <StackPanel Height="66" Orientation="Horizontal">
- <TextBlock VerticalAlignment="Center" Text="电平状态:" />
- <Grid
- Width="36"
- Height="36"
- Margin="4,0,0,0">
- <Ellipse
- Width="36"
- Height="36"
- StrokeThickness="1">
- <Ellipse.Style>
- <Style TargetType="Ellipse">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Path=Level}" Value="True">
- <Setter Property="Stroke" Value="Red" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Path=Level}" Value="False">
- <Setter Property="Stroke" Value="Green" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Ellipse.Style>
- </Ellipse>
- <Ellipse
- Width="32"
- Height="32"
- Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Grid}, Path=Children[0].Stroke}" />
- </Grid>
- <TextBlock Margin="4,0,0,0" VerticalAlignment="Center">
- <TextBlock.Style>
- <Style TargetType="TextBlock">
- <Style.Triggers>
- <DataTrigger Binding="{Binding Path=Level}" Value="True">
- <Setter Property="Text" Value="高电平" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Path=Level}" Value="False">
- <Setter Property="Text" Value="低电平" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </TextBlock.Style>
- </TextBlock>
- </StackPanel>
- </StackPanel>
- <Button
- Grid.Row="1"
- Width="122"
- Height="36"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Command="{Binding SaveCommand}"
- Content="确认"
- FontSize="16" />
- </Grid>
- </UserControl>
|