Added ForceFree

This commit is contained in:
TheJoKlLa 2021-09-25 21:29:44 +02:00
parent cb98542072
commit f41b69cfd8
4 changed files with 31 additions and 7 deletions

View File

@ -21,9 +21,17 @@
</StackLayout>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="{Binding MachineItem.Name}" Style="{StaticResource LabelStyle_Title}"/>
<Button Text="Use" Command="{Binding UseMachineCommand}" IsVisible="{Binding MachineItem.CanUse}" Style="{StaticResource Style_Button_Primary}"/>
<Button Text="GiveBack" Command="{Binding GiveBackMachineCommand}" IsVisible="{Binding MachineItem.CanInUse}" Style="{StaticResource Style_Button_Primary}"/>
<Label Text="{Binding MachineItem.Description}" Style="{StaticResource Style_Label_Text}"/>
<StackLayout IsVisible="{Binding MachineItem.CanUse}">
<Button Text="Use" Command="{Binding UseMachineCommand}" Style="{StaticResource Style_Button_Primary}"/>
</StackLayout>
<StackLayout IsVisible="{Binding MachineItem.CanInUse}">
<Button Text="GiveBack" Command="{Binding GiveBackMachineCommand}" Style="{StaticResource Style_Button_Primary}"/>
</StackLayout>
<StackLayout IsVisible="{Binding MachineItem.CanManage}">
<Label Text="Manage Machine:" Style="{StaticResource Style_Label_Property_Title}"/>
<Button Text="Force Free" Command="{Binding ForceFreeMachineCommand}" Style="{StaticResource Style_Button_Primary}"/>
</StackLayout>
</StackLayout>
</StackLayout>
</ContentPage.Content>

View File

@ -25,6 +25,7 @@ namespace Borepin.PageModel
UseMachineCommand = new DelegateCommand(UseMachineCommandExecuted);
GiveBackMachineCommand = new DelegateCommand(GiveBackMachineCommandExecuted);
ForceFreeMachineCommand = new DelegateCommand(ForceFreeMachineCommandExecuted);
}
#endregion
@ -85,12 +86,27 @@ namespace Borepin.PageModel
await inUseInterface.GiveBack();
await LoadData();
}
private ICommand _ForceFreeMachineCommand;
public ICommand ForceFreeMachineCommand
{
get => _ForceFreeMachineCommand;
set => SetProperty(ref _ForceFreeMachineCommand, value);
}
private async void ForceFreeMachineCommandExecuted()
{
Machine.IManageInterface manageInterface = _Machine.Manage;
await manageInterface.ForceFree();
await LoadData();
}
#endregion
#region INavigationService
public override void OnNavigatedFrom(INavigationParameters parameters)
{
}
public override void OnNavigatedTo(INavigationParameters parameters)

View File

@ -14,9 +14,9 @@
<Grid RowSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5" />
<ColumnDefinition Width="7*" />
<ColumnDefinition Width="6*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="1" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>

View File

@ -9,7 +9,7 @@
<ColumnDefinition Width="5" />
<ColumnDefinition Width="7*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="1*" />
<ColumnDefinition Width="2*" />
<ColumnDefinition Width="1" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>