How can I open UXWindow using UXStackItem (declarative) ?

3 replies. Last post: July 20, 2011 8:49 AM by Yudi
Tags :
  • (None)

Hi 

Maybe I forgot something ? ... but How can set xaml to open UXWindow using UXStackItem ?

I've tried :

1. NavigateUri propetry :  

<Intersoft:UXStackItem Text="Notepad" Icon="/Assets/Files/html.png" NavigateUri="/Views/notepad.xaml"/>

...without any result

2. open via Command:

<Intersoft:UXStackItem Text="Development Roadmap[ands]"

 Icon="/Assets/Files/doc.png" 
 Command="Intersoft:WindowCommands.LaunchApplication"  >
   <Intersoft:UXStackItem.CommandParameter>
      <Intersoft:WindowOptions Uri="/Views/Notepad.xaml" ForceSingleInstance="True" />
   </Intersoft:UXStackItem.CommandParameter>
</Intersoft:UXStackItem>

It's working only when I set addition two parameters: 

CommandTarget="{Binding ElementName=uxDesktop}"
IsEnabled="True"

Is it really necessary ?



 Kind regards

Andrzej

All Replies

Yudi Member

Sorry for the late respond.

UXStackItem implements both ICommandSource and INavigationSource that allows both commanding and navigation using UXStackItem.

In your scenario, clicking the UXStackItem will be used to launch an application within the UXDesktop. So it would be best to use commanding instead of navigation. The commanding can be done through Command, CommandTarget, and CommandParameter.

So by modifying the UXStackItem from the following:

<Intersoft:UXStackItem Text="Development Roadmap" Icon="/Assets/Files/doc.png"/>

into the following will be able to have the UXStackItem to open UXWindow as your required scenario.

<Intersoft:UXStackItem Text="Development Roadmap" Icon="/Assets/Files/doc.png"
                        Command="Intersoft:WindowCommands.LaunchApplication"
                        CommandTarget="{Binding ElementName=uxDesktop}"
                        IsEnabled="True">
    <Intersoft:UXStackItem.CommandParameter>
        <Intersoft:WindowOptions Uri="/Views/Notepad.xaml" ForceSingleInstance="True" WindowName="wndNotepad"/>
    </Intersoft:UXStackItem.CommandParameter>
</Intersoft:UXStackItem>

Hope this helps.

Hi Yudi,

It's the same solution as I've written in my post

Could you give me answers on:

1. why NavigateUri propetry not working ?

2. why I have to set IsEnable=true (it should be default value)

 

Kind regards

Andrzej

Yudi Member

1. why NavigateUri propetry not working ?

UXStackItem implements both ICommandSource and INavigationSource interface to support commanding and navigation, such as shown in the following example.

<Intersoft:UXStackButton Content="Button" HorizontalAlignment="Center" Height="64" VerticalAlignment="Bottom" Width="64" Icon="ShareLarge.png" StackMode="MenuStyle">
    <Intersoft:UXStackItem Icon="twitter.png" Text="Twitter" NavigateUri="www.twitter.com" TargetName="_blank"/>
    <Intersoft:UXStackItem Icon="facebook.png" Text="Facebook" NavigateUri="www.facebook.com" TargetName="_blank"/>
    <Intersoft:UXSeparator></Intersoft:UXSeparator>
    <Intersoft:UXStackItem Icon="email.png" Text="Forward" Command="{Binding ForwardCommand}"/>
</Intersoft:UXStackButton>

You can do commanding through Command, CommandTarget and CommandParameter properties (just like you did) and navigation using NavigateUri and TargetName properties.

2. why I have to set IsEnable=true (it should be default value)

I will consult this with the ClientUI development team. I’ll get back to you as soon as possible.

All times are GMT -5. The time now is 4:26 AM.
Previous Next