Wpf Converter - Dependency Injection in Xaml - wpf

I am trying to use dependency injection for my converter in the Xaml code as described at:
[https://github.com/PrismLibrary/Prism/releases/tag/7.1.0-pre1][1]
This requires the use of Prism.Forms
xmlns:ioc="clr-namespace:Prism.Ioc;assembly=Prism.Forms"
this though causes a conflict
Error CS0433 The type 'IDialogService' exists in both
'Prism.Forms, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=null' and
'Prism.Wpf, Version=7.2.0.1422, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59'
Isn't Prism.Forms for Xamarin forms app only?
Why is Prism.Ioc missing from Prism.Wpf?
Will the above conflict cause problems?
Maybe I am missing something?
Thanks for your attention.
Peter

Related

WPF avalon wizard missing wizard control after adding System.xmal

I tried Avalong Wizard control for WPF and have the following issue could you guys help me spot the problem.
Added Avalon reference as per the tutorial and made some changes to the xmal for the window
and the wizrd appears. using the control or right options I can change the page, add or remove a page.
I added few pages and controls for each.
Then when I tried to rebuild the project I got the following messages
Errors
Error 1
The type 'System.Windows.Markup.IQueryAmbient' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. D:\SkyDrive\Dev Zone\Ms.NET\Projects\SDF_Export\SDF_Export\Window1.xaml.cs
Error2
The type name 'IComponentConnector' could not be found in the namespace 'System.Windows.Markup'. This type has been forwarded to assembly 'System.Xaml, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' Consider adding a reference to that assembly. D:\SkyDrive\Dev Zone\Ms.NET\Projects\SDF_Export\SDF_Export\obj\Debug\Window1.g.cs
Then added the reference System.Xaml - Rebuild sucessfully
Tested the project everything works fine in the application where I am able to switch pages
Issue
When I come back to do more changes to the project wizard control is missing.
Now I cannot change, add, remove page using the wizrd control or the right click options.
I have attached the project here with.
Project Files

Silverlight Designer not finding custom controls

I'm having an issue where silverlight doesn't recognise custom controls or resources.
I include the namespace and intelisense recognises the item, the application builds fine and runs fine however the designer throws the following error.
The type 'x' was not found. Verify that you are not missing an assembly reference
and that all referenced assemblies have been built.
Usually I'm able to sort out the issue by performing a clean/rebuild of the project. however recently this route has been unable to resolve the issue.
Is this a known issue with the Visual Studio designer? are there any fixes/work arounds out there?
Thanks
EDIT:
I'm using the following declaration:
xmlns:converters="clr-namespace:x.Classes.Converters"
and referencing the control using the following:
<converters:ReportTypeImageConverter x:Name="ReportTypeImage"/>
Restarted visual studio this morning when I logged in and now its recognising the controls, which means I can use the designer again.
Try to go to your Project Properties and put some Reference Paths(folders where you .dll are)
Hope it Helps

Cannot create instance of 'Ribbon'

I'm having trouble using the Ribbon control from the Office 2007 RibbonControlsLibrary.dll.
It works for most people but not for me. The fault I get is:
Cannot create instance of 'Ribbon' defined in assembly 'RibbonControlsLibrary, Version=3.5.31016.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Exception has been thrown by the target of an invocation
The problem is probably not with the code since it works for other people.
Its the Ribbon class thats causing the problem. If I remove any references to the Ribbon class but keep the references to RibbonWindow I don't get any exceptions.
Any help appreciated
I fixed it...
My problem was that RibbonControlsLibrary.dll was in the GAC... as soon as I removed it from the GAC it worked like a charm...

WPF: Analyse XamlParseException from UserControl in .dll

I have a custom WPF UserControl in a DLL file. I access the UserControl from PowerBuilder via OleObject (COM). I'm trying to create an instance of the UserControl (code in .NET dll).
Everything works fine when I'm using it via COM from C++, but in PowerBuilder, I'm getting this error message:
Error Message
Can you help me to figure out, what the problem is?
Tell me, if you need some more information.
Thank you so much!!
Found the solution. :)
Had to load the assembly WPFToolkit.dll and System.Windows.Controls.DataVisualization.Toolkit.dll manually via Assembly.LoadFrom("...");
Now it works!
I think you will have to load all assemblies which contain custom classes which are used in the xaml this way.

WPF Service Control app won't build

I have the following code:
XAML code for Window1.xaml and the VB.Net code for Window1.xaml.vb.
The error I get is the following:
"Cannot create instance of 'Window1' defined in assembly 'ServiceControl, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation. Error in markup file 'ServiceControl;component/Window1.xaml' Line 2 Position 2."
I can't see any problem in the code and what it should do is trigger an animation depending on the status of a service (spooler service in this case). It may be because I am manually referencing to the System.ServiceProcess namespace, which is not available in WPF framework by default, but I'm not sure. Anybody can help?
Thanks.
You're only looking at the top level exception message. Drill in and look at the inner exception.

Resources