For some reason every time I use a Grid control in WPF, I get these two settings mixed up. The difference is subtle but simple, and it has a huge impact on how your content is displayed. The important thing to remember is that ‘Auto’ will size the row or column based on its content, […]
C#
Opening a StorageFile as System.IO.Stream
This one is easy, but a bit tricky if you are just looking it up online. When working with a Universal App in Windows, you generally use the new Windows.Storage.StorageFile class. This works great, except when you need to get a System.IO.Stream instance. If you do a quick google search, the simple way is to […]
Enabling Drag and Drop over a Grid in WPF
Recently I needed to enable drag and drop in a WPF application. The idea was to allow users to drop a file on the application window and the application would automatically open that file. Sounds simple, right? All it should take is to set the AllowDrop property to true on the Grid: <Grid HorizontalAlignment=”Stretch” DockPanel.Dock=”Top” […]