Isssue with SplitButton under WPF

1 reply. Last post: December 26, 2011 9:49 PM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback

Hi, I'm trying to implement a split button under wpf.  If I click on the drop down button and then click anywhere outside the control the default action is still implemented.  This does not happen under Silverlight for the same code.  I have attached a simple project to demonstrate.  Just click on the drop down button and then click somewhere else on the window, not the on the split button.  The default action will be trigged.  You will notice a commented line of code that can be used to partially correct this issue.  However I don't believe it will work if you set the command property rather then handle the click event. Thanks, Jonathan

<Window x:Class="WpfApplication27.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Intersoft="clr-namespace:Intersoft.Client.UI.Aqua;assembly=Intersoft.Client.UI.Aqua"
    Title="MainWindow">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto" />
      <RowDefinition Height="*" />
    </Grid.RowDefinitions>
    <Intersoft:UXSplitButton Name="SampleControl1" Content="Save" Click="SampleControl1_OnClick" Width="100">
      <Intersoft:UXMenuItem Header="Save and Create New" Click="UXMenuItem_OnClick" />
      <Intersoft:UXMenuItem Header="Save and Create New With Same Store" Click="UXMenuItem_OnClick" />
      <Intersoft:UXMenuItem Header="Save and Create New With Same Target" Click="UXMenuItem_OnClick" />
    </Intersoft:UXSplitButton>
  </Grid>
</Window>

 using System.Windows;

using Intersoft.Client.UI.Aqua;
namespace WpfApplication27 {
  public partial class MainWindow {
    public MainWindow() {
      InitializeComponent();
    }
    private void SampleControl1_OnClick(object sender, RoutedEventArgs e) {
      MessageBox.Show("SampleControl1_Click");
      //if (!((UXSplitButton)sender).IsDropDownOpen) MessageBox.Show("SampleControl1_Click");
    }
    private void UXMenuItem_OnClick(object sender, Intersoft.Client.Framework.ISRoutedEventArgs e) {
      MessageBox.Show("UXMenuItem_Click");
    }
  }
}

 P.S. I tried to use the developer network to report this problem, but received a server error each time I logged on.

All times are GMT -5. The time now is 7:52 PM.
Previous Next