You can set your controls up in xaml as follows:
<scrollviewer scrollviewer.horizontalscrollbarvisibility="Auto">
ScrollViewer.VerticalScrollBarVisibility="Auto">
<canvas x:name="canMain" xmlns:x="#unknown">
<image x:name="imgMain" />
</canvas>
</scrollviewer>
Then subscribe to the inner controls size changed event. In my case I'm using a image but you can replace it what ever suits your needs.
imgMain.SizeChanged += ImgMain_SizeChanged;
Then in the set the width and height of your canvas to the new sizes of you image.
private void ImgMain_SizeChanged(object sender, SizeChangedEventArgs e)
{
canMain.Height = e.NewSize.Height;
canMain.Width = e.NewSize.Width;
}