Saturday, October 30, 2010

Website updates

joshwerts.com has been updated (the photoviewer code).  Now, the photos have next and previous buttons so you don't have to close it and reopen it for every photo.  Also updated the style and fixed the picture window so that it sizes correctly for each photo (and re-centers the childwindow if necessary).  The re-centering issue turned out to be quite difficult to solve, but this code from  Johnny Basic - http://forums.silverlight.net/forums/t/166750.aspx did the trick:


private void LayoutRoot_SizeChanged(object sender, SizeChangedEventArgs e)
{
    var root = VisualTreeHelper.GetChild(this, 0) as FrameworkElement;
    var contentRoot = root.FindName("ContentRoot") as FrameworkElement;

    var group = contentRoot.RenderTransform as TransformGroup;

    if (group.Children.Count == 6)
   {  
    var tf1 = group.Children[3] as TranslateTransform;
    var tf2 = group.Children[5] as TranslateTransform;

    // reset transform
    tf2.X = 0;
    tf2.Y = 0;
    }
}


Next up is adding support for different albums, and then adding some pictures in categories.

Tuesday, October 5, 2010

I dot-commed myself:

joshwerts.com - overall and/or photography site (work in progress)

grad.joshwerts.com - professional/resume/grad school info

Enjoy.