Skip to content

Instantly share code, notes, and snippets.

View PatrickGrub's full-sized avatar
:atom:
Coding

Patrick Gruber PatrickGrub

:atom:
Coding
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
Defining custom Targets to execute before project compilation starts.
-->
<PropertyGroup>
<CompileDependsOn>
CommonBuildDefineModifiedAssemblyVersion;
$(CompileDependsOn);
</CompileDependsOn>
@PatrickGrub
PatrickGrub / tOnDataGridDoubleClickEvenRaiseEventForRow.ps1
Created July 10, 2018 11:42
Hook to DataGrid DoubleClickEvent and receive Information about the row
function Add-DataGridDoubleClickEventOnRow {
param(
[System.Windows.Controls.DataGrid]$DatagridControl,
[System.Windows.Input.MouseButtonEventHandler]$ScriptBlock
)
$rowStyle = New-Object System.Windows.Style -ArgumentList @([System.Windows.Controls.DataGridRow])
$eventSetter = New-Object System.Windows.EventSetter -ArgumentList @([System.Windows.Controls.DataGridRow]::MouseDoubleClickEvent, $scriptBlock)
$rowStyle.Setters.Add($eventSetter)
$datagridControl.RowStyle = $rowStyle
}
function Show-MessageBox {
param(
$Title = "The cool Dialog",
[Parameter(Mandatory=$true)]
$Message,
[System.Windows.Forms.MessageBoxIcon]$Icon = "Information",
[System.Windows.Forms.MessageBoxButtons]$Buttons = "Ok"
)
[System.Windows.Forms.MessageBox]::Show($Message, $Title, $Buttons, $Icon) | Out-Null
}