This commit is contained in:
DESKTOP-E17406D\boonkerz 2024-12-16 09:02:29 +01:00
parent 39f3516b2e
commit db8075b8f3
6 changed files with 21 additions and 0 deletions

View File

@ -45,6 +45,8 @@ public partial class ServerViewModel : ViewModelBase, IViewModelBase
public ReactiveCommand<Unit, Unit> AptUpdate { get; }
public ReactiveCommand<Unit, Unit> ReScan { get; }
public ReactiveCommand<Unit, Unit> Reboot { get; }
public ReactiveCommand<Unit, Unit> SelectAll { get; }
public ReactiveCommand<Unit, Unit> DeSelectAll { get; }
protected readonly ReadOnlyObservableCollection<Server> _server;
public ReadOnlyObservableCollection<Server> Server => _server;
@ -60,6 +62,8 @@ public partial class ServerViewModel : ViewModelBase, IViewModelBase
AptUpdate = ReactiveCommand.Create(doAptUpdate);
ReScan = ReactiveCommand.Create(doReScan);
Reboot = ReactiveCommand.Create(doReboot);
SelectAll = ReactiveCommand.Create(selectAll);
DeSelectAll = ReactiveCommand.Create(deSelectAll);
_settingsManager = (SettingsManager)Ioc.Default.GetService<ISettingsManager>();
ServerService.SourceCache.Connect()
// Sort Ascending on the OrderIndex property
@ -177,4 +181,19 @@ public partial class ServerViewModel : ViewModelBase, IViewModelBase
}
}
}
void selectAll()
{
foreach (var serv in Server)
{
serv.IsChecked = true;
}
}
void deSelectAll()
{
foreach (var serv in Server)
{
serv.IsChecked = false;
}
}
}

View File

@ -27,6 +27,8 @@
<Button Content="ReScan" Command="{Binding ReScan}"></Button>
<Button Content="Apt Upgrade" Command="{Binding AptUpdate}"></Button>
<Button Content="Reboot" Command="{Binding Reboot}"></Button>
<Button Content="Select ALL" Command="{Binding SelectAll}"></Button>
<Button Content="DeSelect ALL" Command="{Binding DeSelectAll}"></Button>
<!-- <TextBox Grid.Row="1" Text="{Binding Json}"></TextBox>-->
</StackPanel>

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.