forked from ChrisTitusTech/winutil
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add Selected Apps Label, Reshuffel the nesting of the checkbox and the label to be able to reference the name from the actual checkbox * Add visual selection and allow click on the whole app section * Fix Theme definition to work with theme change * Fix Highlight on if label or icon is clicked * change applications.json to powershell object list and refactor UI Creation logic * Optimization and Add Collapsable Categories * Add Button functionality for install, uninstall, info, install selected, uninstall selected, clear and implement search * Rest application.json to Main * Reset Compile to main * Pretty much revamp_apps but without changes to applications.json * Small fixes
- Loading branch information
Showing
8 changed files
with
632 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
function Invoke-WPFSelectedLabelUpdate { | ||
<# | ||
.SYNOPSIS | ||
This is a helper function that is called by the Checked and Unchecked events of the Checkboxes on the install tab. | ||
It Updates the "Selected Apps" Label on the Install Tab to represent the current collection | ||
.PARAMETER type | ||
Eigther: Add | Remove | ||
.PARAMETER checkbox | ||
should contain the current instance of the checkbox that triggered the Event. | ||
Most of the time will be the automatic variable $this | ||
.EXAMPLE | ||
$checkbox.Add_Unchecked({Invoke-WPFSelectedLabelUpdate -type "Remove" -checkbox $this}) | ||
OR | ||
Invoke-WPFSelectedLabelUpdate -type "Add" -checkbox $specificCheckbox | ||
#> | ||
param ( | ||
$type, | ||
$checkbox | ||
) | ||
$selectedLabel = $sync.WPFSelectedLabel | ||
# Get the actual Name from the Label inside the Checkbox | ||
$appKey = $checkbox.Parent.Parent.Tag | ||
if ($type -eq "Add") { | ||
$sync.selectedApps.Add($appKey) | ||
# The List type needs to be specified again, because otherwise Sort-Object will convert the list to a string if there is only a single entry | ||
[System.Collections.Generic.List[pscustomobject]]$sync.selectedApps = $sync.SelectedApps | Sort-Object | ||
} | ||
elseif ($type -eq "Remove") { | ||
$sync.SelectedApps.Remove($appKey) | ||
} | ||
else{ | ||
Write-Error "Type: $type not implemented" | ||
} | ||
$count = $sync.SelectedApps.Count | ||
$SelectedLabel.Content = "Selected Apps: $count" | ||
if ($count -gt 0) { | ||
$SelectedLabel.ToolTip = $($sync.SelectedApps | Foreach-Object { $SortedAppsHashtable.$_.Content }) -join "`n" | ||
} else { | ||
$SelectedLabel.ToolTip = $Null | ||
} | ||
} |
Oops, something went wrong.