Protagonist
Protagonist
CC#
Created by Protagonist on 2/28/2025 in #help
.NET MAUI Android Dashcam App
My goals is to get recording to work and save it on another page which i havent created yet, but main focus right now is for recording to work
7 replies
CC#
Created by Protagonist on 2/28/2025 in #help
.NET MAUI Android Dashcam App
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="Dashy.Views.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:vm="clr-namespace:Dashy.ViewModels"
BackgroundColor="Black"
x:DataType="vm:MainViewModel">

<Grid>
<toolkit:CameraView
x:Name="backCameraView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>

<Label
Text="REC"
TextColor="Red"
FontSize="16"
FontAttributes="Bold"
HorizontalOptions="Start"
VerticalOptions="Start"
Margin="40,60"
IsVisible="{Binding IsRecording}"/>

<Label
Text="{Binding RecordingStatus}"
TextColor="White"
FontSize="14"
HorizontalOptions="Center"
VerticalOptions="Start"
Margin="0,100"/>

<Button
x:Name="recordButton"
Text="{Binding RecordButtonText}"
Command="{Binding ToggleRecordingCommand}"
HorizontalOptions="Center"
VerticalOptions="End"
Margin="20"
WidthRequest="80"
HeightRequest="80"
CornerRadius="40"/>
</Grid>
</ContentPage>
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="Dashy.Views.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:vm="clr-namespace:Dashy.ViewModels"
BackgroundColor="Black"
x:DataType="vm:MainViewModel">

<Grid>
<toolkit:CameraView
x:Name="backCameraView"
HorizontalOptions="FillAndExpand"
VerticalOptions="FillAndExpand"/>

<Label
Text="REC"
TextColor="Red"
FontSize="16"
FontAttributes="Bold"
HorizontalOptions="Start"
VerticalOptions="Start"
Margin="40,60"
IsVisible="{Binding IsRecording}"/>

<Label
Text="{Binding RecordingStatus}"
TextColor="White"
FontSize="14"
HorizontalOptions="Center"
VerticalOptions="Start"
Margin="0,100"/>

<Button
x:Name="recordButton"
Text="{Binding RecordButtonText}"
Command="{Binding ToggleRecordingCommand}"
HorizontalOptions="Center"
VerticalOptions="End"
Margin="20"
WidthRequest="80"
HeightRequest="80"
CornerRadius="40"/>
</Grid>
</ContentPage>
7 replies
CC#
Created by Protagonist on 2/28/2025 in #help
.NET MAUI Android Dashcam App
using Dashy.ViewModels;
using Dashy.Interfaces;

namespace Dashy.Views;

public partial class MainPage : ContentPage
{
private readonly MainViewModel _viewModel;

public MainPage(MainViewModel viewModel, ICameraService cameraService)
{
InitializeComponent();
BindingContext = _viewModel = viewModel;

cameraService.Initialize(backCameraView);
}

protected override async void OnAppearing()
{
base.OnAppearing();
await _viewModel.InitializeCameraAsync();
}
}
using Dashy.ViewModels;
using Dashy.Interfaces;

namespace Dashy.Views;

public partial class MainPage : ContentPage
{
private readonly MainViewModel _viewModel;

public MainPage(MainViewModel viewModel, ICameraService cameraService)
{
InitializeComponent();
BindingContext = _viewModel = viewModel;

cameraService.Initialize(backCameraView);
}

protected override async void OnAppearing()
{
base.OnAppearing();
await _viewModel.InitializeCameraAsync();
}
}
using Dashy.Interfaces;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.Threading.Tasks;

namespace Dashy.ViewModels
{
public partial class MainViewModel : BaseViewModel
{
private readonly ICameraService _cameraService;

[ObservableProperty]
private string _recordButtonText = "Start Recording";

[ObservableProperty]
private bool _isRecording;

[ObservableProperty]
private string _recordingStatus = "Idle";

public MainViewModel(ICameraService cameraService)
{
_cameraService = cameraService;
}

[RelayCommand]
private async Task ToggleRecordingAsync()
{
if (IsRecording)
{
RecordingStatus = "Stopping...";
await _cameraService.StopRecordingAsync();
IsRecording = false;
RecordingStatus = "Idle";
}
else
{
RecordingStatus = "Starting...";
await _cameraService.StartRecordingAsync();
IsRecording = true;
RecordingStatus = "Recording...";
}

RecordButtonText = IsRecording ? "Stop Recording" : "Start Recording";
}

public async Task InitializeCameraAsync()
{
await _cameraService.StartPreviewAsync();
}
}
}
using Dashy.Interfaces;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System.Threading.Tasks;

namespace Dashy.ViewModels
{
public partial class MainViewModel : BaseViewModel
{
private readonly ICameraService _cameraService;

[ObservableProperty]
private string _recordButtonText = "Start Recording";

[ObservableProperty]
private bool _isRecording;

[ObservableProperty]
private string _recordingStatus = "Idle";

public MainViewModel(ICameraService cameraService)
{
_cameraService = cameraService;
}

[RelayCommand]
private async Task ToggleRecordingAsync()
{
if (IsRecording)
{
RecordingStatus = "Stopping...";
await _cameraService.StopRecordingAsync();
IsRecording = false;
RecordingStatus = "Idle";
}
else
{
RecordingStatus = "Starting...";
await _cameraService.StartRecordingAsync();
IsRecording = true;
RecordingStatus = "Recording...";
}

RecordButtonText = IsRecording ? "Stop Recording" : "Start Recording";
}

public async Task InitializeCameraAsync()
{
await _cameraService.StartPreviewAsync();
}
}
}
7 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
so you either set the consolewindow or display a set amount, then have something like next and before for example
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
ah okay i think i might understand now what could be a workaround, i was testing some things out and its like it says its cos the scroll, anything above that is what retains
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
Thank you boss <3, it looks like there is no solution though which is strange
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
I done everything anyones asked here yet he didnt want to believe me like id lie
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
i cooperated and you had no soultion
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
when he was proved wrong and i show him his "impossible" was possible he gave up
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
no its not. i did as he asked ne he jut quit
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
No need to leave, just say you got proven wrong. 😛 @ero
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
the only line that gets cleared is the please"
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
Im telling you it is
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
this is the step over.
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
did i not show u that here @ero
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
look
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
Lemme see if i can get a vid of it
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
Well its happening
102 replies
CC#
Created by Protagonist on 11/7/2024 in #help
Console Doesn't Clear and Provides nested outputs
nothing is impossible
102 replies