Edit MainPage title in Silverlight 5 - xaml

We're going to use Silverlight 5 for an out-of-browser application and need to have an individual title of the main window. In Silverlight 4 it was not possible to set this property as far as I know (See this issue). By default the main window has the title of the project followed by "Application". Does Silverlight 5 bring the ability to change the main window title? Maybe even during runtime via data binding?

In your silverlight project-->Properties->OutOfBrowserSettings.xml you can update the Title.
Please find my sample Settings Page below.
<OutOfBrowserSettings ShortName="My OOB Application" EnableGPUAcceleration="False" ShowInstallMenuItem="True">
<OutOfBrowserSettings.Blurb>This is my first OOB Application in SL 5.0</OutOfBrowserSettings.Blurb>
<OutOfBrowserSettings.WindowSettings>
<WindowSettings Title="My OOB Application" />
</OutOfBrowserSettings.WindowSettings>
<OutOfBrowserSettings.SecuritySettings>
<SecuritySettings ElevatedPermissions="Required" />
</OutOfBrowserSettings.SecuritySettings>
<OutOfBrowserSettings.Icons>
<Icon Size="16,16">Images/XX-16x16px.png</Icon>
<Icon Size="32,32">Images/XX-32x32px.png</Icon>
<Icon Size="48,48">Images/XX-48x48px.png</Icon>
<Icon Size="128,128">Images/XX-128x128px.png</Icon>
</OutOfBrowserSettings.Icons>
</OutOfBrowserSettings>
Here, WindowSettings-->Title will give the Main window title & ShortName will give the Application name in the shortcuts.
Thanks & Regards,
Rousseau Arulsamy

The title of the main window application can be adjusted during runtime only via "Application.Current.MainWindow.Title". This doesn't really comply to the MVVM approach since you can't bind to title property of the main window. This is only possible for child windows, since you create those yourself in your code and have full control over them. The main window is provided by the system and is created during application startup. So you can't bind to the properties during runtime. During initialization the main window is set up with the parameters from the "OutOfBrowserSettings.xml" As I said, it is only possible to adjust the main window parameters "directly" via Application.Current.MainWindow...

Related

Caliburn Micro navigation service resulting in nullreference exception

I am using the ViewModel First approach and i have trouble navigating from one ViewModel to another.
For example, i have two folders, View and ViewModels and i have two files in each Page1View.xaml, Page2View.xaml and Page1ViewModel.cs, Page2ViewModel.cs
In my app launch i have this the line below and it works perfectly fine.
DisplayRootViewFor<Page1ViewModel>();
Now on a button click from Page1ViewModel event when i add the line below, i get a null reference exception.
_navigationService.NavitageToViewModel<Page2ViewModel>();
Am i missing something here? To give more information, This is a UWP application and the container that i am using is WinRTContainer and i have registered both the ViewModels.
You are taking a ViewModel-first approach. Note that DisplayRootViewFor doesn't create a Frame control and doesn't set up a NavigationService.
Have a look at:
https://github.com/Caliburn-Micro/Caliburn.Micro/issues/126
Either switch to a View-first approach, or in your root view, setup a NavigationService passing a Frame to it:
container.RegisterNavigationService(rootFrame);

Developing Top AppBar for windows 8

I am developing a simple application for windows 8. And now I want to modify the top app bar( i.e it should not look like bottom app bar) and I want it to work much better than only showing the default icons(like navigation job). I want to add my icons of different sizes(length).yes similar to those of weather app or travel app. But I am unable to find any good reference to start with. please help, from where I should start doing it. and whether is it possible to modify the app bar. please guide. note: I am developing app in javascript
Your very basic top appbar can be implemented using the following HTML:
<div data-win-control="WinJS.UI.AppBar" data-win-options="{layout:'custom',placement:'top'}">
<!-- your custom top bar content goes here -->
</div>
From inside the div, you can add anything to your hearts content, even AppBarCommands. Don't forget to initialize all win controls:
<script>
document.addEventListener("DOMContentLoaded", function () {
WinJS.UI.processAll();
}, false);
</script>
Quickstart: adding an app bar with custom content
Read following article, you'll get lot's of good tips
31 Days of Windows 8 | Day #4: New Controls

Is calling doLayout() method a must after adding child to a parent?

In our application, there is a tabpanel in which we are adding/removing the panel dynamically.
The panels get added at the click of a menu item by the following code in menu handler:
Ext.getCmp('mainTabPanelId').add(getPanel());
Here getPanel() method returns the panel after creating it.
Assuming that the id of main tab panel is mainTabPanelId and that of the child panel is panelId, in this context, could someone guide at the following:
Is it necessary to call doLayout() on mainTabPanel after the add method?
Should the doLayout() be called on the mainTabPanel or on the newly added child panel, that is, Ext.getCmp('mainTabId').doLayout() or Ext.getCmp('panelId').doLayout()?
Will a call to doLayout() take care of all the issues related to rendering, like scrollbars esp.?
The method getPanel() should return an already created panel (using Ext.create) or should it return a config object (having xtype:'panel')? Which one should be preferred for better performance keeping time in mind?
AbstractContainer::add()
<...> If the Container was configured with a size-managing layout manager, the Container will recalculate its internal layout at this time too.
So you don't have to do 1 — 3 because:
AbstractContainer::doLayout()
<...> The framework uses this internally to refresh layouts form most cases.
AbstractContainer::defaults
For defaults to work, the child items must be added using {xtype: ......} NOT using Ext.create("widget.type",{}) © roger.spall
So I'd prefer return configuration object instead of components itself.

How to Apply Dynamic Themes In Silverlight?

I am creating Silverlight Application. In My Application I want to add Functionality for dynamically change Themes. Like I have two Themes(Blue.xaml, Gray.xaml).
And In My Home Page there are two button which is Blue and Gray. I want to Change Theme based on Button Click.
Can any one help me?
Thnx in Advance.
Silverlight Toolkit has Theming support (use the latest Silverlight 5 Toolkit - December 2011)
use Theme control and set ThemeUri in controls
<toolkit:Theme x:Name="ThemeContainer"
ThemeUri="/System.Windows.Controls.Theming.BubbleCreme;component/Theme.xaml">
<Button>
....
</Button>
</toolkit:Theme>
Ref :http://weblogs.asp.net/lduveau/archive/2010/05/31/dynamically-apply-and-change-theme-with-the-silverlight-toolkit.aspx

some of the toolbar menus are not seen in eclipse rcp application

When I launch rcp application some of the custom toolbar menus doesnot appear in my rcp application,if I change perspective then they appears.Any idea?
That's hard to say with no additional information. How do you create those toolbar items? Using some contributor class or in plugin.xml, using menu contributions? With the second option, check, that you have defined them in the proper plugin.xml (the one, which defines your perspective, in which you want to actually see them).
Ensure, that there are handlers for your commands/actions in your perspective.
If you are using associations, ensure, that those are correct:
<extension point="org.eclipse.ui.actionSetPartAssociations">
<actionSetPartAssociation targetID="YouractionSetId">
<part id="YourPartId"/>
</actionSetPartAssociation>