Alap BUGFIX javításhoz

This commit is contained in:
2025-07-02 13:32:33 +02:00
parent 6be6bc533c
commit bc977af15c
4 changed files with 20 additions and 5 deletions
@@ -3,6 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WorkFlowCheck.MAUI.Pages.CheckList.CheckListWorkPage"
xmlns:templateselectors="clr-namespace:WorkFlowCheck.MAUI.TemplateSelectors"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:local="clr-namespace:WorkFlowCheck.MAUI.Pages.CheckList"
BackgroundColor="#f0f0f0"
Title="">
@@ -134,7 +135,14 @@
Aspect="AspectFill"
Margin="0,0,10,0"
VerticalOptions="Center"
Source="{Binding Photo, Converter={StaticResource ByteArrayToImageSourceConverter}}" />
Source="{Binding Photo, Converter={StaticResource ByteArrayToImageSourceConverter}}" >
<Image.Behaviors>
<toolkit:EventToCommandBehavior
EventName="BindingContextChanged"
Command="{Binding BindingContext.RefreshImageCommand, Source={x:Reference CheckPointCheckListRows}}"
CommandParameter="{Binding .}" />
</Image.Behaviors>
</Image>
<Button Text="📷" Grid.Column="1"
VerticalOptions="Center"
Command="{Binding BindingContext.TakePhoto, Source={x:Reference CheckPointCheckListRows}}"
@@ -30,10 +30,16 @@ public partial class CheckListWorkPage : ContentPage
}
}
public ObservableCollection<CheckListRowDTO> CheckListRows { get; set; } = new ObservableCollection<CheckListRowDTO>();
public ICommand RefreshImageCommand => new Command<CheckListRowDTO>(item =>
{
int i = 0;
// Ha kell, itt újra lehet állítani valamit vagy logolni
//Debug.WriteLine($"Kép frissítés: {item.Id}");
});
public ICommand TakePhoto { get; set; }
public ICommand SendCommand { get; set; }
public ICommand SaveCommand { get; set; }
public CheckListWorkPage(int checkListHeaderId, string checkPointCode)
{
InitializeComponent();
@@ -275,7 +281,7 @@ public class ByteArrayToImageSourceConverter : IValueConverter
{
return ImageSource.FromStream(() => new MemoryStream(bytes));
}
return null;
return ImageSource.FromFile("noimage.png"); ;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)