iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hy,
i'm using UXDesktop and UXDesktopDock and i wanna open a new window with UXStackItem.
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.
First I tried it to open a UXWindow that is located in the same assembly as the UXDesktop.
I do this with the CommandTarget, CommentParameter. That works fine.
The question is now, how can i load the assembly first, when i click on the UXStackItem.
Is there a chance to generate the commanding in code behind and launch that command in code behind to open the UXWindow.
cheers
Mike
Apologize for the delay in sending this.
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 Intersoft WebUI Studio 2012 R1. We are about to launch a window when user click on a UXStackItem. The window is a specific page from an external XAP.
The url will open Desktop Dock sample. You may try to click on one of the UXStackItem inside the Pictures UXDesktopDockButton (right next to the separator). In the next step, we are going to add our own UXStackItem, let’s say Custom. This stack item will be used to launch a window from a specific xaml page of external XAP.
In this sample, Default.xaml page which is located inside the “Views\UXClock” folder of Intersoft.ClientUI.Samples.UXInput project will be launch when user clicks our Custom UXStackItem.
To add external application to the UXShell and download the application package.
private void Application_Startup(object sender, StartupEventArgs e) { this.RootVisual = new MainPage(UXShell.Current.RootApplication); }
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); }
To add and configure Custom UXStackItem.
<Intersoft:UXDesktopDockButton Icon="/Intersoft.ClientUI.Samples.WindowControls;component/Assets/Images/Dock/pictures.png" Text="Pictures" StackMode="MenuStyle"> ... <Intersoft:UXStackItem Text="Custom" Command="Intersoft:WindowCommands.LaunchApplication" CommandTarget="{Binding ElementName=SampleDesktop}"> <Intersoft:UXStackItem.CommandParameter> <Intersoft:WindowOptions ForceSingleInstance="True" ReactivateExistingInstance="True" Uri="/Intersoft.ClientUI.Samples.UXInput;Intersoft.ClientUI.Samples.UXInput.Views.UXClock.Default"/> </Intersoft:UXStackItem.CommandParameter> </Intersoft:UXStackItem> </Intersoft:UXDesktopDockButton>
Hope this helps.
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.
<Intersoft:UXDesktopDock x:Name="desktopDock"> <Intersoft:UXDesktopDockButton Text="Local Application" Icon="/Images/App1.png" ApplicationUri="/Views/LocalWindow.xaml"/> <Intersoft:UXDockSeparator/> <Intersoft:UXDesktopDockButton Text="Application 1" Icon="/BookShelf.png" ApplicationUri="ExternalClientUIApp2.xap"/> </Intersoft:UXDesktopDock>
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.
Should you need to implement this from a delegate command, you may try to set the Uri of WindowOptions to the corresponding xap file.
For more detail information, please check How to: Launch a Window in External Application Package in ClientUI documentation.
Hy Yudi,
thx for your replie.
I also check this HowTo to get an answer. But the ApplicationUri attribute is not available in Intersoft:UXStackItem.
I wanna do something like this:
<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">
<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"> <Intersoft:UXStackItem.CommandParameter> <Intersoft:WindowOptions Uri="/Hainzl.Web.Silverlight.Candas.Benutzer;Hainzl.Web.Silverlight.Candas.Benutzer.BenutzerWindow" ForceSingleInstance="True" ReactivateExistingInstance="True" /> </Intersoft:UXStackItem.CommandParameter> </Intersoft:UXStackItem></Intersoft:UXDesktopDockButton>
Hello,
As you noticed, you would need to use binding CommandParameter. After use WindowCommands.LauchApplication, you need to set CommandParameter binding.Using ViewModel, you can set your windows option parameter. Since it has Uri property, you should be able to achieve your scenario.
Example:
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; } }
Regards,Handy
thx for the replay.
This post helps me to solve my problem!
cheers mike
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname