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>
<StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}"> <StackLayout IsVisible="{Binding IsBusy, Converter={StaticResource InvertBoolConverter}}">
<Label Text="{Binding MachineItem.Name}" Style="{StaticResource LabelStyle_Title}"/> <Label Text="{Binding MachineItem.Name}" Style="{StaticResource LabelStyle_Title}"/>
<Label Text="{Binding MachineItem.Description}" Style="{StaticResource Style_Label_Text}"/>
<Button Text="Use" Command="{Binding UseMachineCommand}" IsVisible="{Binding MachineItem.CanUse}" Style="{StaticResource Style_Button_Primary}"/> <StackLayout IsVisible="{Binding MachineItem.CanUse}">
<Button Text="GiveBack" Command="{Binding GiveBackMachineCommand}" IsVisible="{Binding MachineItem.CanInUse}" Style="{StaticResource Style_Button_Primary}"/> <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>
</StackLayout> </StackLayout>
</ContentPage.Content> </ContentPage.Content>

View File

@ -25,6 +25,7 @@ namespace Borepin.PageModel
UseMachineCommand = new DelegateCommand(UseMachineCommandExecuted); UseMachineCommand = new DelegateCommand(UseMachineCommandExecuted);
GiveBackMachineCommand = new DelegateCommand(GiveBackMachineCommandExecuted); GiveBackMachineCommand = new DelegateCommand(GiveBackMachineCommandExecuted);
ForceFreeMachineCommand = new DelegateCommand(ForceFreeMachineCommandExecuted);
} }
#endregion #endregion
@ -85,6 +86,21 @@ namespace Borepin.PageModel
await inUseInterface.GiveBack(); await inUseInterface.GiveBack();
await LoadData(); 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 #endregion
#region INavigationService #region INavigationService

View File

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

View File

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