use Microsoft.Windows.Shell.SystemCommands for min, max, restore
set SnapsToDevicePixels before SizeToContent

known bug, solution taken from http://stackoverflow.com/q/4671633/920384