none
Hosting WPF application in CCF 2009 Agent desktop RRS feed

  • Question

  • Can we host WPF(Window presentatino Foundation) application/usercontrol library in CCF 2009 Agent desktop?
    If yes then how?
    If no then any alternatives?

    Regards,
    Chetan
    Chetan
    Wednesday, November 25, 2009 1:33 PM

All replies

  • Did anyone find an answer to this question?

    I tried to build a WPF control by extending the CCF HostedControl, but got stuck with the XAML file which complains the the Grid element is supported (error message: Cannot add content to object of type 'Microsoft.Ccf.Csr.HostedControl'):
    <src:HostedControl
    x:Class="WpfCtiControl.CtiControl"
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    xmlns:src="clr-namespace:Microsoft.Ccf.Csr;assembly=Microsoft.Ccf.Csr.Core" Height="300" Width="300">
    <Grid>
    <Button Height="34" Margin="114,68,113,0" Name="btnAgentLogin" VerticalAlignment="Top" Click="btnAgentLogin_Click">Log in</Button>
    </Grid>
    </src:HostedControl>

    And this is part of the code behind page:

    public partial class CtiControl : HostedControl
        {
            public CtiControl()
            {
                InitializeComponent();
            }

            // Necessary constructor for HostedControl
            public CtiControl(int appID, string appName, string initString)
                : base(appID, appName, initString)
            {
                InitializeComponent();
            }

    Any help would be appreciated,

    Stuart.

    Friday, March 12, 2010 4:56 AM
  • Found it!

    After installing the CCF 2009 SP1 QFE edition I found the WPF sample code.
    I changed the xaml file to

    <

     

    src:HostedWpfControl
    x:Class="WpfCtiControl.CtiControl"
    xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
    xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml
    xmlns:src="clr-namespace:Microsoft.Ccf.Csr.Aif.HostedApplication;assembly=Microsoft.Ccf.Csr.Core"
    Height="300" Width="300">

    And extended a different base class:

    using Microsoft.Ccf.Csr.Aif.HostedApplication;

    using Microsoft.Ccf.Csr;

    namespace WpfCtiControl
    {

        /// <summary>
        /// Interaction logic for CtiControl.xaml
        /// </summary>
        public partial class CtiControl : HostedWpfControl


    It now works fine and can even see the designer again.

    So I strongly suggest to install the QFE release (for a laugh, look up what QFE stands for) and have a look at the sample code that comes with it.

    Good luck,

    Stuart.

    Monday, March 15, 2010 12:28 AM