I just uploaded a test with another method, by using IMFCaptureEngine :
(only tested on Windows 10)
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I don't Know what to do, I am really struggling.
I need to use the webcam, to take a picture of the user, I need to add the camera preview here.
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<demy:AppTitleBarControl
x:Name="AppBar"
ShowIcon="false"
Text="Register" />
<StackPanel
Grid.Row="1"
Width="600"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="20">
<TextBox
PlaceholderText="First name"
Text="{x:Bind ViewModel.User.Name}" />
<TextBox
PlaceholderText="Second name"
Text="{x:Bind ViewModel.User.SecondName}" />
<TextBox PlaceholderText="Phone Number"
Text="{x:Bind ViewModel.User.Phone}"/>
<TextBox
PlaceholderText="Email Address"
Text="{x:Bind ViewModel.User.Email}" />
<PasswordBox
Password="{x:Bind ViewModel.User.Password}"
PasswordRevealMode="Peek"
PlaceholderText="Password" />
<PasswordBox Password="{x:Bind ViewModel.User.ConfirmPassword}"
PasswordRevealMode="Peek"
PlaceholderText="Confirm password" />
//webcam
</StackPanel>
</Grid>
and this is my vm
[ObservableProperty]
private User user;
public RegisterWindowViewModel(ILocation _location) {
}
[RelayCommand]
private async void RegisterAsync(User user) {
//take picture
}
I tried to use one of these workarounds
https://github.com/microsoft/microsoft-ui-xaml/issues/4710
but that did not work for me or I am doing something wrong
I even tried to use CommunityToolkit.WinUI which has a CameraPreview but I could not get it to work
I just uploaded a test with another method, by using IMFCaptureEngine :
(only tested on Windows 10)