Fluent for .NET 4

Apr 7, 2010 at 6:04 AM
Edited Apr 7, 2010 at 11:34 AM

After I've upgraded my project to .NET 4 and replace the old Fluent assembly with the new one for .NET 4 RC I cant use Groups with InRibbonGallery.

The error is

System.NullReferenceException
Object reference not set to an instance of an object.
   at Fluent.InRibbonGallery.GetItemGroupName(Object obj)
   at Fluent.InRibbonGallery.OnFiltering(Object obj, FilterEventArgs e)
   at System.Windows.Data.CollectionViewSource.WrapFilter(Object item)
   at System.Windows.Data.CollectionViewSource.FilterStub.WrapFilter(Object item)
   at System.Windows.Data.ListCollectionView.PassesFilter(Object item)
   at System.Windows.Data.CollectionView.MoveCurrentTo(Object item)
   at Fluent.InRibbonGallery.<.ctor>b__0(Object , RoutedEventArgs )
   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.Media.MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
   at System.Windows.Interop.HwndTarget.OnResize()
   at System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

Also Office themes are not working.

Curious but in your sample grouping works fine.

Here's my code

<Fluent:InRibbonGallery MinItemsInRow="3" MaxItemsInRow="3" ItemWidth="46" ItemHeight="50" ResizeMode="None" GroupBy="Tag"
                                            LargeIcon="/RibbonTest;component/Images/CrossBrowser.png">
                        <Fluent:Button Text="1" LargeIcon="/RibbonTest;component/Images/Charts-in-the-Box.png" Tag="Grup1" />
                        <Fluent:Button LargeIcon="/RibbonTest;component/Images/ClientSideAPI.png"  Tag="Grup1"/>
                        <Fluent:Button Text="hjksajhdka" LargeIcon="/RibbonTest;component/Images/Enhanced-RichText.png" Tag="Grup1" />
                        <Fluent:Button LargeIcon="/RibbonTest;component/Images/Cookies.png"  Tag="Grup2"/>
                        <Fluent:Button LargeIcon="/RibbonTest;component/Images/ExportingFormats.png"  Tag="Grup2" />
                        <Fluent:Button LargeIcon="/RibbonTest;component/Images/CrossBrowser.png"  Tag="Grup2" />
                        <Fluent:InRibbonGallery.Filters>
                            <Fluent:GalleryGroupFilter Title="Toti" Groups="Grup1,Grup2" x:Name="galleryFilterAll"/>
                            <Fluent:GalleryGroupFilter Title="Grupul 1" Groups="Grup1"/>
                            <Fluent:GalleryGroupFilter Title="Grupul 2" Groups="Grup2"/>
                        </Fluent:InRibbonGallery.Filters>
                    </Fluent:InRibbonGallery> 

 

and code for themes


 <ResourceDictionary Source="pack://application:,,,/Fluent;Component/Themes/Office2010/Blue.xaml" />

Thank's

P.S.

The error appears because of theese lines

<Fluent:GalleryGroupFilter Title="Toti" Groups="Grup1,Grup2" x:Name="galleryFilterAll"/>
<Fluent:GalleryGroupFilter Title="Grupul 1" Groups="Grup1"/>
<Fluent:GalleryGroupFilter Title="Grupul 2" Groups="Grup2"/>

If I comment them I donțt get any errors, the grouping works but with Title of the group not a custom one.