Improve FrameworkElementAdapters.ViewToContractAdapter

493 views Asked by At

I'm using MAF(System.addin) with FrameworkElements between Host and AddIn.

I'm using FrameworkElementAdapters.ViewToContractAdapter and FrameworkElementAdapters.ContractToViewAdapter in the adpters.

I take times of FrameworkElementAdapters.ViewToContractAdapter with stopwatcher , and results in seconds is 1,3 s .

   public INativeHandleContract GetToolBox()
    {

        FrameworkElement e=view.GetControl();
        Stopwatch w = new Stopwatch();
        w.Start();
        INativeHandleContract c= FrameworkElementAdapters.ViewToContractAdapter(e);
        w.Stop();
        System.Console.WriteLine(w.Elapsed.TotalSeconds); ///Results is 1,3

        return c;
    }

Is it possible to improve time of FrameworkElementAdapters.ViewToContractAdapter ?

Thanks

0

There are 0 answers