|
| 1 | +<Page x:Class="Captura.WebcamPlacementPreviewPage" |
| 2 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 3 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 4 | + xmlns:captura="clr-namespace:Captura" |
| 5 | + Title="{Binding WebCam, Source={StaticResource Loc}, Mode=OneWay}" |
| 6 | + DataContext="{Binding MainViewModel, Source={StaticResource ServiceLocator}}"> |
| 7 | + <Grid Margin="5,0"> |
| 8 | + <Grid.ColumnDefinitions> |
| 9 | + <ColumnDefinition Width="250"/> |
| 10 | + <ColumnDefinition Width="Auto"/> |
| 11 | + <ColumnDefinition Width="*"/> |
| 12 | + </Grid.ColumnDefinitions> |
| 13 | + <StackPanel DataContext="{Binding Settings.WebcamOverlay}"> |
| 14 | + <DockPanel> |
| 15 | + <captura:ModernButton ToolTip="{Binding Refresh, Source={StaticResource Loc}, Mode=OneWay}" |
| 16 | + Command="{Binding WebcamModel.RefreshCommand, Source={StaticResource ServiceLocator}}" |
| 17 | + IconData="{Binding Icons.Refresh, Source={StaticResource ServiceLocator}}" |
| 18 | + DockPanel.Dock="Right"/> |
| 19 | + |
| 20 | + <captura:ModernButton ToolTip="Camera Properties" |
| 21 | + Click="CameraProperties_OnClick" |
| 22 | + IconData="{Binding Icons.Settings, Source={StaticResource ServiceLocator}}" |
| 23 | + DockPanel.Dock="Right"/> |
| 24 | + |
| 25 | + <captura:ModernButton ToolTip="Capture Image" |
| 26 | + Click="CaptureImage_OnClick" |
| 27 | + IconData="{Binding Icons.Camera, Source={StaticResource ServiceLocator}}" |
| 28 | + DockPanel.Dock="Right"/> |
| 29 | + |
| 30 | + <Path Data="{Binding Icons.Webcam, Source={StaticResource ServiceLocator}}" |
| 31 | + Width="15" |
| 32 | + Height="15" |
| 33 | + Margin="0,0,7,0" |
| 34 | + Stretch="Uniform" |
| 35 | + HorizontalAlignment="Center" |
| 36 | + VerticalAlignment="Center" |
| 37 | + ToolTip="{Binding WebCam, Source={StaticResource Loc}, Mode=OneWay}"/> |
| 38 | + |
| 39 | + <ComboBox ItemsSource="{Binding WebcamModel.AvailableCams, Source={StaticResource ServiceLocator}}" |
| 40 | + SelectedItem="{Binding WebcamModel.SelectedCam, Mode=TwoWay, Source={StaticResource ServiceLocator}}" |
| 41 | + IsEnabled="{Binding ViewConditions.CanChangeWebcam.Value, Source={StaticResource ServiceLocator}}" |
| 42 | + DisplayMemberPath="Name" |
| 43 | + VerticalAlignment="Center" |
| 44 | + Margin="0,0,7,0"/> |
| 45 | + </DockPanel> |
| 46 | + |
| 47 | + <CheckBox IsChecked="{Binding SeparateFile}" |
| 48 | + Content="{Binding WebCamSeparateFile, Source={StaticResource Loc}, Mode=OneWay}" |
| 49 | + IsEnabled="{Binding ViewConditions.IsEnabled.Value, Source={StaticResource ServiceLocator}}" |
| 50 | + Visibility="{Binding ViewConditions.CanWebcamSeparateFile.Value, Source={StaticResource ServiceLocator}, Converter={StaticResource BoolToVisibilityConverter}}" |
| 51 | + Margin="0,5"/> |
| 52 | + |
| 53 | + <Grid Margin="0,15,0,5"> |
| 54 | + <Grid.ColumnDefinitions> |
| 55 | + <ColumnDefinition Width="Auto"/> |
| 56 | + <ColumnDefinition Width="Auto"/> |
| 57 | + <ColumnDefinition Width="*"/> |
| 58 | + </Grid.ColumnDefinitions> |
| 59 | + |
| 60 | + <Path Data="{Binding Icons.Opacity, Source={StaticResource ServiceLocator}}" |
| 61 | + Width="15" |
| 62 | + Height="15" |
| 63 | + Margin="0,0,10,0" |
| 64 | + Stretch="Uniform" |
| 65 | + HorizontalAlignment="Center" |
| 66 | + VerticalAlignment="Center"/> |
| 67 | + |
| 68 | + <Label Content="{Binding Opacity, Source={StaticResource Loc}, Mode=OneWay}" |
| 69 | + ContentStringFormat="{}{0}: " |
| 70 | + Grid.Column="1" |
| 71 | + Margin="0,3"/> |
| 72 | + |
| 73 | + <Slider Grid.Column="2" |
| 74 | + Minimum="1" |
| 75 | + Maximum="100" |
| 76 | + Value="{Binding Opacity, Mode=TwoWay}" |
| 77 | + SmallChange="1" |
| 78 | + LargeChange="10"/> |
| 79 | + </Grid> |
| 80 | + </StackPanel> |
| 81 | + <GridSplitter Grid.Column="1" |
| 82 | + Width="1" |
| 83 | + Margin="5,0"/> |
| 84 | + <DockPanel Grid.Column="2" |
| 85 | + DataContext="{Binding Settings.WebcamOverlay}"> |
| 86 | + <DockPanel Margin="5" |
| 87 | + DockPanel.Dock="Top"> |
| 88 | + <Label Content="Scale: "/> |
| 89 | + <Slider Value="{Binding Scale, Mode=TwoWay}" |
| 90 | + TickPlacement="BottomRight" |
| 91 | + TickFrequency="0.1" |
| 92 | + SmallChange="0.01" |
| 93 | + LargeChange="0.1" |
| 94 | + Minimum="0" |
| 95 | + Maximum="1"/> |
| 96 | + </DockPanel> |
| 97 | + |
| 98 | + <DockPanel VerticalAlignment="Center" |
| 99 | + HorizontalAlignment="Center" |
| 100 | + Margin="0,0,0,10"> |
| 101 | + <DockPanel DockPanel.Dock="Bottom" |
| 102 | + Margin="5,5,40,5"> |
| 103 | + <Label Content="X" |
| 104 | + Margin="0,0,5,0"/> |
| 105 | + <Slider Value="{Binding XLoc, Mode=TwoWay}" |
| 106 | + SmallChange="0.01" |
| 107 | + LargeChange="0.1" |
| 108 | + Minimum="0" |
| 109 | + Maximum="1"/> |
| 110 | + </DockPanel> |
| 111 | + <DockPanel DockPanel.Dock="Right" |
| 112 | + Margin="5"> |
| 113 | + <Label Content="Y" |
| 114 | + HorizontalContentAlignment="Center" |
| 115 | + Margin="0,0,0,5" |
| 116 | + DockPanel.Dock="Top"/> |
| 117 | + <Slider Value="{Binding YLoc, Mode=TwoWay}" |
| 118 | + Orientation="Vertical" |
| 119 | + IsDirectionReversed="True" |
| 120 | + SmallChange="0.01" |
| 121 | + LargeChange="0.1" |
| 122 | + Minimum="0" |
| 123 | + Maximum="1"/> |
| 124 | + </DockPanel> |
| 125 | + <Grid Name="PreviewGrid" |
| 126 | + Background="DimGray"> |
| 127 | + <Image Name="Img" |
| 128 | + Stretch="Uniform"/> |
| 129 | + |
| 130 | + <!-- Invisible but still required to prevent render errors --> |
| 131 | + <Label Name="PreviewTarget" |
| 132 | + HorizontalAlignment="Left" |
| 133 | + VerticalAlignment="Top" |
| 134 | + Background="#00FFFFFF" |
| 135 | + MaxWidth="{Binding ActualWidth, ElementName=Img}" |
| 136 | + MaxHeight="{Binding ActualHeight, ElementName=Img}"/> |
| 137 | + </Grid> |
| 138 | + </DockPanel> |
| 139 | + </DockPanel> |
| 140 | + </Grid> |
| 141 | +</Page> |
0 commit comments