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

Error When Including the External XAML Template for GridView

3 Answers 45 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 25 Jan 2018, 02:22 PM

In my project, I want to modify the XAML template of the GridView (Literally I only need to change the colors of the Windows8TouchPallete, but I want to do it in XAML not code behind). So, I extracted the XAML template from the Themes.Implicit (I'm using the NoXAML binaries) and included the template as a resource.

The XAML designer shows an error "ArgumentNullException: Key cannot be null. Parameter name: key" when ever I build the project.

I have created a VERY SIMPLE project that reproduces the issue, zipped it up and uploaded it to Dropbox if you would like to take a look at the issue.

https://www.dropbox.com/s/wk94vf6a9k3mz54/TestDataGridTheme.zip?dl=0

Any help is appreciated. Alternatively, if there is a way to modify the Windows8TouchPallete from XAML (in an external XAML file is preferred) then, I would rather do that.

 

 

 

3 Answers, 1 is accepted

Sort by
0
Dilyan Traykov
Telerik team
answered on 30 Jan 2018, 10:44 AM
Hello Paul,

Currently there's no way to modify the palette colors via XAML, however, you can vote for the following feature request in our feedback portal regarding such support.

Though I was not able to reproduce the ArgumentNullException you referenced, I noticed that no theme binaries are referenced and no dictionaries are merged in the App.xaml style as suggested in the implicit styles section of the Setting a Theme article. If you have note done so already, please check the Xaml vs NoXaml article to get a better understanding of when to use each of the binary sets.

I've updated the project you provided and modified it so that the custom styles in the DataGrid.xaml file are correctly applied. Could you please have a look and let me know if you manage to run the project at your end?

I look forward to your reply.

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Paul
Top achievements
Rank 1
answered on 08 Feb 2018, 01:10 PM

Thanks Dilyan!

Is there a way to modify the palette colors via code?  I saw an example, but it wasn't clear how to do it.  Could it be done in the App.xaml.cs file and then apply to all uses in the application?

Thanks again,

Paul

 

 

0
Dilyan Traykov
Telerik team
answered on 08 Feb 2018, 03:14 PM
Hello Paul,

I've updated the previous project so that the changes made to the Windows8TouchPalette are applied. Here are the lines of interest:

public App()
{
    Windows8TouchPalette.Palette.MainColor = Colors.Gray;
    Windows8TouchPalette.Palette.AccentColor = Colors.Orange;
    Windows8TouchPalette.Palette.ValidationColor = Colors.Red;
    Windows8TouchPalette.Palette.EffectHighColor = Colors.Yellow;
    Windows8TouchPalette.Palette.EffectLowColor = Colors.Orange;
}

Please let me know if this works at your end as well.

Regards,
Dilyan Traykov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Paul
Top achievements
Rank 1
Answers by
Dilyan Traykov
Telerik team
Paul
Top achievements
Rank 1
Share this question
or