Hi. I'm trying to make a Lync add-in with the PresenceIndicator control but it has been impossible. The point is i've made a windows form application with the WPF control and it works fine, but when i make the add-in exactly the same way and i open the page with Dynamics Nav, it shows the "Microsoft.Dynamcis.Nav.Client dejó de funcionar" error and Nav is closed. If i use another control, for example a Combo in the WPF UserControl instead of the PresenceIndicator Control, it works fine for Navision.
The error appears in the instantiation of the WPF UserControl:
"
persona contacto = new persona();"
persona is the name of the UserControl
That's the XAML code for the UserControl:
<UserControl x:Class="AddInSamples.persona"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:control="clr-namespace:Microsoft.Lync.Controls;assembly=Microsoft.Lync.Controls"
mc:Ignorable="d"
d:DesignHeight="40" d:DesignWidth="132">
<Grid>
<control:PresenceIndicator Source="yo@correo.es" />
</Grid>
</UserControl>
I don't know what am i doing wrong. Why does it work in the Windows Forms application and it fails in the Add-In? Why does it work with a combo and fails with de Lync Control? I've also tried with other Lync Controls and it fails too.
Does anyone have an example that actually works with Lync Controls?
Thanks, and i'm sorry for my english.
Comments
Which should be because .NET versions incompatibility.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I've been trying to follow the example in http://blogs.msdn.com/b/nav/archive/2011/06/17/presence-control-add-in-in-microsoft-dynamics-nav-with-lync.aspx?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+MicrosoftDynamicsNavTeamBlog+%28Microsoft+Dynamics+NAV+Team+Blog%29
There is a video showing the funcionality working. I've tried to contact the author but i haven't get an answer so far. Any ideas on how is it done? Maybe with another components?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
NAV Add-Ins have to be WinForm Controls. The Contorl in the SDK is a WPF Control.
one way of doing it is to first to Make a WPFUserControl and drag the actual Lync WPF Control on it. Then embedd this New Control in your WinForm UserControl Form(System.Windows.Forms.UserControl) using the WPF ElementHost Container Control in the Toolbar (System.Windows.Forms.Integration.ElementHost).
Hope it helps!
Ad if you read Goyo post, he is working in same way - WPF control hosted in WinApp...
I am not sure, if additional enveloping the control into user control will help...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Are your Add-in project targetting .NET 3.5?
As stated above hosting of WPF controls must be done using an ElementHost.
Thanks,
/henrik
Henrik Metzger, Software Development Engineer, Dynamics NAV
MSFT