﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - Launch Command in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Launch-Command-in-code-behind/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Launch Command in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Launch-Command-in-code-behind/</link><pubDate>Fri, 06 Jul 2012 02:55:07 GMT</pubDate><dc:creator>MikeTurrento</dc:creator><description>&lt;p&gt;Hy Yudi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thx for the replay. &lt;/p&gt;
&lt;p&gt;This post helps me to solve my problem!&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;cheers mike&lt;/p&gt;</description></item><item><title>Launch Command in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Launch-Command-in-code-behind/</link><pubDate>Tue, 26 Jun 2012 23:41:14 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Apologize for the delay in sending this.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Please allow me to guide about how to open a window from an external XAP file. In the step-by-step below, I assume that you have installed &lt;strong&gt;Intersoft WebUI Studio 2012 R1&lt;/strong&gt;. We are about to launch a window when user click on a UXStackItem. The window is a specific page from an external XAP.&lt;/span&gt;&lt;/p&gt;
&lt;ol style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;li&gt;Open &lt;strong&gt;ClientUI Controls C# Sample (Visual Studio 2010 Solution)&lt;/strong&gt; – start &amp;gt; All Programs &amp;gt; Intersoft WebUI Studio 2012 R1 &amp;gt; WebUI Studio for Silverlight 5 &amp;gt; Development Samples (Visual Studio 2010 Solution) &amp;gt; ClientUI Controls C# Sample (Visual Studio 2010 Solution).&lt;/li&gt;&lt;li&gt;After the solution is opened, press Ctrl &amp;#43; F5 to run the project.&lt;/li&gt;&lt;li&gt;A browser window with its url is set to: &lt;em&gt;http://localhost:7373/Default.html&lt;/em&gt; (or something similar to this, url may vary on different development environment settings) will appear.&lt;/li&gt;&lt;li&gt;Modify the url into the following: &lt;em&gt;http://localhost:7373/Default.html#/WindowControls/UXDesktopDock&lt;/em&gt; and press Enter.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;The url will open Desktop Dock sample. You may try to click on one of the UXStackItem inside the &lt;strong&gt;Pictures&lt;/strong&gt; UXDesktopDockButton (right next to the separator). In the next step, we are going to add our own UXStackItem, let’s say &lt;strong&gt;Custom&lt;/strong&gt;. This stack item will be used to launch a window from a specific xaml page of external XAP.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;In this sample, &lt;strong&gt;Default.xaml&lt;/strong&gt; page which is located inside the “&lt;em&gt;Views\UXClock&lt;/em&gt;” folder of &lt;em&gt;Intersoft.ClientUI.Samples.UXInput&lt;/em&gt; project will be launch when user clicks our Custom UXStackItem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;To add external application to the UXShell and download the application package.&lt;/span&gt;&lt;/p&gt;
&lt;ol style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;li&gt;Open &lt;em&gt;App.xaml.cs&lt;/em&gt; of &lt;em&gt;Intersoft.ClientUI.Samples.WindowControls&lt;/em&gt; project.&lt;/li&gt;&lt;li&gt;Find the Application_Startup method.&lt;br /&gt;&lt;pre&gt;private void Application_Startup(object sender, StartupEventArgs e)
{
    this.RootVisual = new MainPage(UXShell.Current.RootApplication);
}&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Modify the method to add external application to the UXShell and download the application package such as shown in the following.&lt;br /&gt;&lt;pre&gt;private void Application_Startup(object sender, StartupEventArgs e)
{
    // External Application is Intersoft.ClientUI.Samples.UXInput
    ApplicationPackage app1 = new ApplicationPackage()
    {
        ID = "Intersoft.ClientUI.Samples.UXInput",
        Name = "Intersoft.ClientUI.Samples.UXInput",
        Source = new Uri("Intersoft.ClientUI.Samples.UXInput.xap", UriKind.RelativeOrAbsolute),
        Size = -1
    };

    UXShell.Current.Applications.Add(app1);
    app1.Download(true);
            
    this.RootVisual = new MainPage(UXShell.Current.RootApplication);
}&lt;/pre&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;To add and configure Custom UXStackItem.&lt;/span&gt;&lt;/p&gt;
&lt;ol style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;&lt;li&gt;Open &lt;em&gt;Default.xaml&lt;/em&gt; of &lt;em&gt;Intersoft.ClientUI.Samples.WindowControls&lt;/em&gt; project.&lt;/li&gt;&lt;li&gt;Add Custom UXStackItem inside the Pictures UXDesktopDockButton such as shown in the following snippet code.&lt;br /&gt;&lt;pre&gt;&amp;lt;Intersoft:UXDesktopDockButton Icon="/Intersoft.ClientUI.Samples.WindowControls;component/Assets/Images/Dock/pictures.png"
                                Text="Pictures" StackMode="MenuStyle"&amp;gt;
    ...
    &amp;lt;Intersoft:UXStackItem Text="Custom" Command="Intersoft:WindowCommands.LaunchApplication"
                            CommandTarget="{Binding ElementName=SampleDesktop}"&amp;gt;
        &amp;lt;Intersoft:UXStackItem.CommandParameter&amp;gt;
            &amp;lt;Intersoft:WindowOptions ForceSingleInstance="True" ReactivateExistingInstance="True"
                                        Uri="/Intersoft.ClientUI.Samples.UXInput;Intersoft.ClientUI.Samples.UXInput.Views.UXClock.Default"/&amp;gt;
        &amp;lt;/Intersoft:UXStackItem.CommandParameter&amp;gt;
    &amp;lt;/Intersoft:UXStackItem&amp;gt;
&amp;lt;/Intersoft:UXDesktopDockButton&amp;gt;&lt;/pre&gt;&lt;/li&gt;&lt;li&gt;Save the changes and press Ctrl &amp;#43; F5 to run the project.&lt;/li&gt;&lt;li&gt;After the browser window loaded, modify the url into the following: http://localhost:7373/Default.html#/WindowControls/UXDesktopDock and press Enter.&lt;/li&gt;&lt;li&gt;Try to click Custom UXStackItem and see the effect.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui', 'sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Launch Command in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Launch-Command-in-code-behind/</link><pubDate>Fri, 22 Jun 2012 06:01:48 GMT</pubDate><dc:creator>MikeTurrento</dc:creator><description>Hi, thx for the replie.&lt;br /&gt;&lt;br /&gt;But I think my problem &lt;span lang="undefined" class="short_text" id="result_box"&gt;&lt;span class="hps"&gt;was not understood.&lt;br /&gt;&lt;br /&gt;I try to explain it more detail:&lt;br /&gt;&lt;br /&gt;I wanna open a Window with a UXStackItem. This UXStackItem is in a UXDesktopDockButton.&lt;br /&gt;My Problem is, that the window, i wanna open, is in an external XAP File. &lt;br /&gt;But there is no way to load an external XAP File with the Command-functions like the ApplicationUri property.&lt;br /&gt;&lt;br /&gt;I managed it to open the window with an normal UXDesktopDockButton and the ApplicationUri property. That was easy and works very well.&lt;br /&gt;&lt;br /&gt;But i find no way to open the same window with an UXStackItem.&lt;br /&gt;&lt;br /&gt;Cheers&lt;br /&gt;Mike&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;</description></item><item><title>Launch Command in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Launch-Command-in-code-behind/</link><pubDate>Fri, 22 Jun 2012 05:51:59 GMT</pubDate><dc:creator>handy@intersoftpt.com</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;&lt;p&gt;As you noticed, you would need to use binding CommandParameter. After use WindowCommands.LauchApplication, you need to set CommandParameter binding.&lt;br /&gt;Using ViewModel, you can set your windows option parameter. Since it has Uri property, you should be able to achieve your scenario.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;p /&gt;&lt;pre&gt; public WindowOptions CommandParameter
 {
      get
      {
         var wo = new WindowOptions()
         {
             Uri = new Uri("ClientUIExternalApp1;ClientUIExternalApp1.Views.SpecificWindow", UriKind.Relative),
             ForceSingleInstance = true,
             ReactivateExistingInstance = false,
             WindowName = string.Format("wndNotepad_{0}", Id),
             WindowGroupName = "Notepad",
             StartupParameters = this,
             WindowWidth = 800,
             WindowHeight = 600,
                   
        };
     return wo;
     }
}&lt;/pre&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Handy&lt;/p&gt;
&lt;p /&gt;</description></item><item><title>Launch Command in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Launch-Command-in-code-behind/</link><pubDate>Fri, 22 Jun 2012 01:34:16 GMT</pubDate><dc:creator>MikeTurrento</dc:creator><description>Nobody that could help me!&lt;br /&gt;</description></item><item><title>Launch Command in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Launch-Command-in-code-behind/</link><pubDate>Thu, 21 Jun 2012 05:04:31 GMT</pubDate><dc:creator>MikeTurrento</dc:creator><description>&lt;p&gt;Hy Yudi,&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;thx for your replie.&lt;/p&gt;
&lt;p&gt;I also check this HowTo to get an answer. But the ApplicationUri attribute is not available in Intersoft:UXStackItem.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;I wanna do something like this:&lt;/p&gt;&lt;pre&gt;&amp;lt;Intersoft:UXDesktopDockButton x:Name="xDesktopButtonSettings" 
       Icon="Assets/Icons/Settings.png" 
       UseImageLoader="False" 
       StackMode="GridStyle" StackGridMode="DynamicGrid" 
       Text="{Binding Source={StaticResource ResourceWrapperCore}, 
                      Path=ApplicationStrings.Einstellungen}" 
       StackTotalDisplayItem="0" StackGridItemWidth="128" 
       StackGridItemHeight="128"&amp;gt;                &lt;/pre&gt;&lt;pre&gt;	&amp;lt;Intersoft:UXStackItem x:Name="xDesktopButtonSettingsStackItemBenutzer"
               Text="{Binding Source={StaticResource ResourceWrapperCore}, 
                              Path=ApplicationStrings.Benutzer}" 
               Icon="Assets/Icons/User.png" 
               Command="Intersoft:WindowCommands.LaunchApplication" 
               CommandTarget="{Binding ElementName=xCandasDesktop}"
               IsEnabled="True"&amp;gt;
               &amp;lt;Intersoft:UXStackItem.CommandParameter&amp;gt;
                   &amp;lt;Intersoft:WindowOptions Uri="/Hainzl.Web.Silverlight.Candas.Benutzer;Hainzl.Web.Silverlight.Candas.Benutzer.BenutzerWindow" 
                         ForceSingleInstance="True" 
                         ReactivateExistingInstance="True" /&amp;gt;
               &amp;lt;/Intersoft:UXStackItem.CommandParameter&amp;gt;
         &amp;lt;/Intersoft:UXStackItem&amp;gt;&amp;lt;/Intersoft:UXDesktopDockButton&amp;gt;&lt;/pre&gt;</description></item><item><title>Launch Command in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Launch-Command-in-code-behind/</link><pubDate>Thu, 21 Jun 2012 04:16:45 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;In order to launch a window in external application package, please set the ApplicationUri property to the application package file which exists in the ClientBin of the Web project.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&amp;lt;Intersoft:UXDesktopDock x:Name="desktopDock"&amp;gt;
    &amp;lt;Intersoft:UXDesktopDockButton Text="Local Application"
                                    Icon="/Images/App1.png"
                                    ApplicationUri="/Views/LocalWindow.xaml"/&amp;gt;
    &amp;lt;Intersoft:UXDockSeparator/&amp;gt;
    &amp;lt;Intersoft:UXDesktopDockButton Text="Application 1"
                                    Icon="/BookShelf.png"
                                    ApplicationUri="ExternalClientUIApp2.xap"/&amp;gt;
&amp;lt;/Intersoft:UXDesktopDock&amp;gt;&lt;/pre&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;In the above example, the ExternalClientUIApp2 package has its MainType assigned to a type that implements IWindow interface such as UXWindow. This enables the windowing framework to automatically dispatch the main type after the package was downloaded, then construct an instance and display the window to the desktop, as if the window were existed locally.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Should you need to implement this from a delegate command, you may try to set the Uri of WindowOptions to the corresponding xap file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;For more detail information, please check &lt;a href="http://www.intersoftpt.com/Support/ClientUI/Docs/topic380.html"&gt;How to: Launch a Window in External Application Package&lt;/a&gt; in ClientUI documentation.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family: 'segoe ui','sans-serif'; color: #1f497d; font-size: 9pt"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Launch Command in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Launch-Command-in-code-behind/</link><pubDate>Wed, 20 Jun 2012 07:28:30 GMT</pubDate><dc:creator>MikeTurrento</dc:creator><description>&lt;p&gt;Hy,&lt;/p&gt;
&lt;p&gt;i'm using UXDesktop and UXDesktopDock and i wanna open a new window with UXStackItem.&lt;/p&gt;
&lt;p&gt;My problem is, that the window I wanna load is in an other assembly and so i must load the assembly first befor I can open the window. &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;First I tried it to open a UXWindow that is located in the same assembly as the UXDesktop.&lt;/p&gt;
&lt;p&gt;I do this with the CommandTarget, CommentParameter. That works fine. &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The question is now, how can i load the assembly first, when i click on the UXStackItem.&lt;/p&gt;
&lt;p&gt;Is there a chance to generate the commanding in code behind and launch that command in code behind to open the UXWindow.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;cheers &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Mike&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>