-1

I try to install using Visual Studio Package Manager Console and got this error:

Install failed. Rolling back... Install-Package : Could not install package 'WinRTXamlToolkit.Controls.Gauge 1.6.1.3'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. At line:1 char:1 + Install-Package WinRTXamlToolkit.Controls.Gau

mark yer
  • 403
  • 6
  • 12

1 Answers1

0

Not as a NuGet package, I think you'd need a WPF Toolkit (of some sort).

WinRT XAML Toolkit is based on CoreCLR, not on the full .NET 4.5.

You can use the source code with very minor modifications though (mostly in namespaces). It depends on which part of the toolkit you need.

Check out the source at https://github.com/xyzzer/WinRTXamlToolkit

Filip Skakun
  • 31,624
  • 6
  • 74
  • 100
  • Well then you just need two files. Getting the whole think would be an overkill. You need to put the cs file anywhere (and fix up namespaces) and get the control template into the generic.xaml file in your WPF app's Themes folder. The cs file is [here](https://github.com/xyzzer/WinRTXamlToolkit/blob/master/WinRTXamlToolkit.Controls.Gauge.UWP/Gauge.cs) and the XAML is [here](https://github.com/xyzzer/WinRTXamlToolkit/blob/master/WinRTXamlToolkit.Controls.Gauge.UWP/Themes/Generic.xaml) – Filip Skakun Oct 13 '15 at 18:38
  • 1. Create simple Class and put the .cs inside ? 2. create ResourceDictionary and give it the name Generic ? – mark yer Oct 13 '15 at 18:40
  • Exactly so. _______________________ – Filip Skakun Oct 13 '15 at 18:42
  • And what about all this using that missing: using Windows.Foundation; using Windows.UI; using Windows.UI.Xaml; using Windows.UI.Xaml.Controls; using Windows.UI.Xaml.Media; using Windows.UI.Xaml.Shapes; – mark yer Oct 13 '15 at 19:14
  • Added several quite different using and now in the line: OnValueChanged(this, null); got an error: Error 110 Argument 2: cannot convert from '' to 'System.Windows.DependencyPropertyChangedEventArgs' – mark yer Oct 13 '15 at 19:21
  • Remove the WinRT usings and resolve missing references using Alt+Shift+F10. As for the dependency property change handlers - you should check out what the WPF syntax is. – Filip Skakun Oct 13 '15 at 19:23