Skip to content

Howto set MinWidth or MinHeight of a WinRT ScrollViewer

I use the ScrollViewer control in a windows 8 metro app in order to zoom in/out an image. The problem now is, that it is possible to zoom in the image untill you almost can't zoom out again(because the image gets so small). I've tried MinWidth and MinHeigt on the ScrollViewer and on the image, but it didn't work. After some time i found the MinZoomFactor of the ScrollViewer, and this now works. It was just not obvious to me...


Exception: That assembly does not allow partially trusted callers

I have .net 3.5 program where i load some assemblies from a network share via reflection. Now i've got the following exception: "That assembly does not allow partially trusted callers''(Detailed message below). The calling assembly(.exe) is local. This .exe loads the assembly from network via reflection. The assembly from the network share then has a reference on a third assembly which is located beneath the .exe. (Hard to explain, image will do better...)

The reason for this failure is the .net security. It doesn't allow the MyLib.dll to be loaded, because the calling assembly is located on a network share and is signed with a strong name.

Solution 1, caspol.exe Allow all code to be executed. This might be dangerous, but if you're desperate it could be a solution.

 "C:\Windows\Microsoft.NET\Framework\v2.0.50727\CasPol.exe" -machine -chggroup All_Code FullTrust

Solution 2, no signing If you remove the signature from MyLib2.dll, everything works.

Solution 3, set attribute AllowPartiallyTrustedCallers If you set the AllowPartiallyTrustedCallers in the AssemblyInfo.cs of the signed assembly, everything works.

using System.Security;

[assembly: AllowPartiallyTrustedCallers()]

Usefull links

Continue reading "Exception: That assembly does not allow partially trusted callers"

MySmug version 1.2 available

MySmug version 1.2 went again smooth through the submission processs, and now is available at the marketplace. New features are:

  • Save single pictures to the phone
  • Upload pictures from phone to smugmug
  • Change the image orientation based on the phone orientation.
  • Performance optimization(Album data caching)

Photo & Video Sharing by SmugMug

What to do if OnOrientationChanged is not fired on windows phone 7 emulator?

If you debug your windows phone application, and the OnOrientationChanged event is not fired, just press Page Up or Page Down. Those keys are used to activate/deactivate the phone keyboard. If the phone keyboard is active, the following code will be executed. Strange thing...

protected override void OnOrientationChanged(OrientationChangedEventArgs e)

Found(after some time) on the microsoft forum.