Gradients in CSS are significantly different to gradients in WPF. Whilst it would be possible to built up and add the relevant styles from the code-behind, it would be much easier to create the gradient in a static CSS file, and apply it to the required elements via a CSS class.
CSS3 Gradients[
^]
linear-gradient() - CSS | MDN[
^]
Ultimate CSS Gradient Generator - ColorZilla.com[
^]
For your example gradient, with support for older browsers included, the required CSS would look something like:
background: #cceeff;
background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2NjZWVmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNmZmRkZWUiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+);
background: -moz-linear-gradient(top, #cceeff 0%, #ffddee 100%);
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#cceeff), color-stop(100%,#ffddee));
background: -webkit-linear-gradient(top, #cceeff 0%,#ffddee 100%);
background: -o-linear-gradient(top, #cceeff 0%,#ffddee 100%);
background: -ms-linear-gradient(top, #cceeff 0%,#ffddee 100%);
background: linear-gradient(to bottom, #cceeff 0%,#ffddee 100%);
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#cceeff', endColorstr='#ffddee',GradientType=0 );
If you can drop support for old versions of IE, the code would be simpler.