This is a migrated thread and some comments may be shown as answers.

source cannot be null

3 Answers 388 Views
FileDialogs
This is a migrated thread and some comments may be shown as answers.
Rémi
Top achievements
Rank 1
Rémi asked on 05 Aug 2020, 08:37 AM

Hello,

I am facing some issues with the FileDialogs Controls in WPF:

When using the controls, none of their fields are recognized (for example, ExplorerControl has no Filter neither Multiselect member)

I created a simple WPF project with only the two following files, and added Assembly references to:

  • Telerik.Windows.Controls
  • Telerik.Windows.Controls.FileDialogs
  • Telerik.Windows.Controls.GridView
  • Telerik.Windows.Controls.Input
  • Telerik:Windows.Controls.Navigation
  • Telerik.Windows.Data

MainWindow.xaml:

<Window x:Class="TelerikTest.MainWindow"
        xmlns:fileDialogs="clr-namespace:Telerik.Windows.Controls.FileDialogs;assembly=Telerik.Windows.Controls.FileDialogs"
        mc:Ignorable="d"
        d:DesignHeight="300"
        d:DesignWidth="300">
    <Grid>
        <fileDialogs:ExplorerControl    x:Name="explorer"/>
    </Grid>
</Window>

 

MainWindow.xaml.cs:

using System.Windows;
using System.Windows.Controls;
 
namespace TelerikTest
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }
    }
}

 

And when trying to run it, I get this exception:

System.ArgumentNullException: 'Value cannot be null. Parameter name: source'

This exception was originally thrown at this call stack:
    System.Linq.Enumerable.OfType<TResult>(System.Collections.IEnumerable)
    Telerik.Windows.Controls.FileDialogs.ExplorerControl.MainNavigationPaneLoaded(object, System.Windows.RoutedEventArgs)
    System.Windows.RoutedEventHandlerInfo.InvokeHandler(object, System.Windows.RoutedEventArgs)
    System.Windows.EventRoute.InvokeHandlersImpl(object, System.Windows.RoutedEventArgs, bool)
    System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject, System.Windows.RoutedEventArgs)
    System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs)
    System.Windows.BroadcastEventHelper.BroadcastEvent(System.Windows.DependencyObject, System.Windows.RoutedEvent)
    System.Windows.BroadcastEventHelper.BroadcastLoadedEvent(object)
    MS.Internal.LoadedOrUnloadedOperation.DoWork()
    System.Windows.Media.MediaContext.FireLoadedPendingCallbacks()
    ...
    [Call Stack Truncated]

Thanks in advance for your reply

Note: I have no issue with direct call to FileDialog dialogs, the following code works:

new RadOpenFileDialog().ShowDialog();

3 Answers, 1 is accepted

Sort by
0
Accepted
Dilyan Traykov
Telerik team
answered on 07 Aug 2020, 10:31 AM

Hello Rémi,

Thank you very much for the provided code snippets.

Using them I set up a small sample project with the 2020.2 803 XAML Telerik UI for WPF binaries, however, I do not observe any exceptions and the ExplorerControl is loaded as expected at my end.

I've attached the sample project I've used as well as a short recording of running the project which also demonstrates that the Filter and Multiselect properties are available.

Can you please try building the project at your end and see if you're able to run it successfully?

If that is the case, I can assume that there is some version mismatch with the assemblies in your project or maybe the NoXaml binaries are used and the required resource dictionaries are not merged. If possible, please troubleshoot both of these steps and let me know if any of them is true.

I will be awaiting your reply.

Regards,
Dilyan Traykov
Progress Telerik

0
Rémi
Top achievements
Rank 1
answered on 10 Aug 2020, 08:38 AM

Hello Dilyan,

I downloaded and tried to run your sample project that gave me the same errors as mine.

I realized that I was provided with an old version of Telerik, so I downloaded the latest version and retry to run both your and my projects and so far it seems to solve the issue.

Thanks a lot for your time,

Best regards,

Rémi

0
Dilyan Traykov
Telerik team
answered on 11 Aug 2020, 01:45 PM

Hello Rémi,

I'm happy to hear that the issue is now resolved. Do let me know if you require any further assistance.

Regards,
Dilyan Traykov
Progress Telerik

Tags
FileDialogs
Asked by
Rémi
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Rémi
Top achievements
Rank 1
Share this question
or