Skip to main content

Posts

Showing posts from October, 2009

Silverlight 3 Page Not Found error

I was working on a project when all of the sudden I started getting a “Page Not Found” error. Of course the page is there and it had been working fine. Turns out it was the templates infrastructure hiding the error from me.When you create a new SL Navigation Application, you’ll find the following in your MainPage.xml.cs.// If an error occurs during navigation, show an error window private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) { e.Handled = true; ChildWindow errorWin = new ErrorWindow(e.Uri); errorWin.Show(); }This nice little piece of code hides the real cause of the error so that all you see is Page Not Found.Bryant Likes has some code that will give you a better idea of the error.// If an error occurs during navigation, show an error window private void ContentFrame_NavigationFailed(object sender, NavigationFailedEventArgs e) { Exception ex = e.Exception; while (ex.InnerException != null) { ex = ex.InnerExcept…

Nice Drop Shadow Border in XAML

I was working with Silverlight 3 and created this drop shadow border. Enjoy.<Style x:Key="DropShadow" TargetType="Border"> <Setter Property="Background" Value="WhiteSmoke" /> <Setter Property="CornerRadius" Value="5" /> <Setter Property="BorderThickness" Value="1,1,4,4" /> <Setter Property="Margin" Value="10" /> <Setter Property="Padding" Value="6" /> <Setter Property="BorderBrush"> <Setter.Value> <LinearGradientBrush> <GradientStop Color="#ccc" Offset="0" /> <GradientStop Color="#ddd" Offset="1" /> </LinearGradientBrush> </Setter.Value> </Setter> </Style>

Using Interfaces, Generics and the Repository Pattern