MahApps / MahApps.Metro

A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort.
https://mahapps.com
MIT License
9.33k stars 2.44k forks source link

NullReferenceException at MahApps.Metro.Controls.FlipView.FlipView_Loaded in designer #2472

Closed capsicumDreams closed 8 years ago

capsicumDreams commented 8 years ago

What steps will reproduce this issue?

Update to 1.2.4 from 1.2.3 VS Pro 2015 Update 2 Include the code:

<Controls:FlipView IsBannerEnabled="False">
    <Controls:FlipView.Items>
        <Image Stretch="UniformToFill" Source="/programName;component/Images/DSC_0037.JPG"/>
        <Image Stretch="UniformToFill" Source="/programName;component/Images/qld.jpg"/>
    </Controls:FlipView.Items>
</Controls:FlipView>

Expected outcome

No exception in the designer! I get a:
NullReferenceException: Object reference not set to an instance of an object.

at MahApps.Metro.Controls.FlipView.FlipView_Loaded(Object sender, RoutedEventArgs e) at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) at System.Windows.BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent) at System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(Object root) at MS.Internal.LoadedOrUnloadedOperation.DoWork() at System.Windows.Media.MediaContext.FireLoadedPendingCallbacks() at System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() at System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) at System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget) at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Environment

  • MahApps.Metro v1.2.4
  • Windows 8.1
  • Visual Studio 2015
  • .NET Framework 4.6
punker76 commented 8 years ago

@capsicumDreams Can you check if this still hapens with the latest pre-release? Cause I've changed some FlipView code. Thx!

capsicumDreams commented 8 years ago

With MahApps.Metro.1.3.0-ALPHA132

It's all good! Thanks a million @punker76.