aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml')
-rw-r--r--Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml108
1 files changed, 75 insertions, 33 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
index b2d553ff2..cf5d1e19e 100644
--- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
+++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/MainView.xaml
@@ -16,6 +16,7 @@
xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
xmlns:observables="clr-namespace:Tango.Integration.Observables;assembly=Tango.Integration"
xmlns:editors="clr-namespace:Tango.SharedUI.Editors;assembly=Tango.SharedUI"
+ xmlns:video="clr-namespace:Tango.Video.DirectCapture;assembly=Tango.Video"
xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI"
xmlns:local="clr-namespace:Tango.MachineStudio.Developer.Views"
mc:Ignorable="d"
@@ -1502,46 +1503,87 @@
</Grid.Style>
<Grid Margin="5 0 0 0">
- <DockPanel Height="850" VerticalAlignment="Top">
+ <DockPanel x:Name="dockCameras" VerticalAlignment="Top" Height="850" Width="330" HorizontalAlignment="Right">
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
<Image Source="../Images/camera.png" Width="42"></Image>
<TextBlock VerticalAlignment="Center" Margin="10 0 0 0" Foreground="DimGray" FontSize="16" FontWeight="SemiBold">USB CAMERAS</TextBlock>
</StackPanel>
- <UniformGrid Rows="3">
- <Border RenderOptions.BitmapScalingMode="Fant">
- <Border.Background>
- <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush>
- </Border.Background>
- <Grid>
- <Label Margin="22 23 0 0" Style="{StaticResource graphLabel}">
- <TextBlock FontFamily="digital-7" VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 1</TextBlock>
- </Label>
- </Grid>
- </Border>
- <Border RenderOptions.BitmapScalingMode="Fant">
- <Border.Background>
- <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush>
- </Border.Background>
+ <ItemsControl ItemsSource="{Binding CaptureDevices}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <UniformGrid Rows="3" />
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
- <Grid>
- <Label Margin="22 23 0 0" Style="{StaticResource graphLabel}">
- <TextBlock FontFamily="digital-7" VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 2</TextBlock>
- </Label>
- </Grid>
- </Border>
- <Border RenderOptions.BitmapScalingMode="Fant">
- <Border.Background>
- <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush>
- </Border.Background>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate DataType="{x:Type video:CaptureDevice}">
+ <Border RenderOptions.BitmapScalingMode="Fant">
+ <Border.Background>
+ <ImageBrush ImageSource="../Images/video-frame.png" Stretch="Fill"></ImageBrush>
+ </Border.Background>
- <Grid>
- <Label Margin="22 23 0 0" Style="{StaticResource graphLabel}">
- <TextBlock FontFamily="digital-7" VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0">CAMERA 3</TextBlock>
- </Label>
- </Grid>
- </Border>
- </UniformGrid>
+ <Grid>
+ <Border Margin="22 24 23 42">
+ <Grid>
+ <Image Source="{Binding VideoSource,Mode=OneWay,IsAsync=True}" Stretch="Fill"></Image>
+
+ <Grid Background="#83000000" Cursor="Hand">
+ <Grid.Style>
+ <Style TargetType="Grid">
+ <Setter Property="Opacity" Value="0"></Setter>
+ <Style.Triggers>
+ <EventTrigger RoutedEvent="MouseEnter">
+ <EventTrigger.Actions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="00:00:0.2"></DoubleAnimation>
+ </Storyboard>
+ </BeginStoryboard>
+ </EventTrigger.Actions>
+ </EventTrigger>
+ <EventTrigger RoutedEvent="MouseLeave">
+ <EventTrigger.Actions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="Opacity" To="0" Duration="00:00:0.2"></DoubleAnimation>
+ </Storyboard>
+ </BeginStoryboard>
+ </EventTrigger.Actions>
+ </EventTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Style>
+
+ <Button Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=DataContext.ToggleCameraCommand}" CommandParameter="{Binding}" Style="{StaticResource MaterialDesignFloatingActionMiniButton}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Width="60" Height="60" Padding="0">
+ <materialDesign:PackIcon Width="40" Height="40">
+ <materialDesign:PackIcon.Style>
+ <Style TargetType="materialDesign:PackIcon">
+ <Setter Property="Kind" Value="Play"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsStarted}" Value="True">
+ <Setter Property="Kind" Value="Stop"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding IsStarted}" Value="False">
+ <Setter Property="Kind" Value="Play"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </materialDesign:PackIcon.Style>
+ </materialDesign:PackIcon>
+ </Button>
+ </Grid>
+ </Grid>
+ </Border>
+
+ <Label Margin="22 23 0 0" Style="{StaticResource graphLabel}">
+ <TextBlock VerticalAlignment="Center" FontSize="10" Margin="0 0 30 0" Text="{Binding Device.Name,FallbackValue='No Camera',TargetNullValue='No Camera'}"></TextBlock>
+ </Label>
+ </Grid>
+ </Border>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
</DockPanel>
</Grid>