Windowing Framework with external xap

2 replies. Last post: March 2, 2011 6:00 AM by Andrzej Sulej
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi 

I am studying the possibility of partitioning applications in the option of Windowing Framework. Your documentation describes a way of using ApplicationURI with xap file name. Very major simplification is indicating only the object defined in MainType. If the application is divided into modules, flexibility is required in the references to all objects (View's) from the external xap.Maybe I have not noticed, but I miss, apart from ApplicationURI, indicating the type of object in external xap also. I simulate this action as follows (using the information in a Tag parameter)


MainPage.xaml 

<Intersoft:UXDesktopDockButton Icon="Assets/Dock/ClientUILogoLarge.png" Text="Open External View" Click="UXDesktopDockButton_Click" Tag="ClientUIDesktopApp2.Notepad" />

MainPage.xaml.cs


 private void UXDesktopDockButton_Click(object sender, RoutedEventArgs e)
        {
            ApplicationPackage app = UXShell.Current.GetApplication("ClientUIDesktopApp2");
            if (app != null)
            {
                // load the application to the current domain context
                app.MainType = ((UXDesktopDockButton)sender).Tag.ToString();
                app.Load();               
                if (app.IsLoaded)
                {                   
                    IWindow win = app.CreateInstance() as IWindow ;                    
                    if (win == null)
                        throw new Exception("Unsupported instance type");
                    win.Show();
                   // Container.Child = element;
                }
            }
        }

 Is it possible to do that in a declarative way ?


The important thing is the flexibility to transfer parameters (objects) to the called external objects (kind of StartupParameters or ... parameter of Constructor my opened view), but I assume that this can be achieved by binding an object WindowOption to CommandParameters, is not it. (as was done in ClientUIDesktopApp example on UXDesktopDockButton with customers).
I miss the complementary example of the solution.
It would be nice to find out more examples in your documentation.


Kind regards

Andrzej




All times are GMT -5. The time now is 11:49 AM.
Previous Next