﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - Possible bug in UXComboBox and UXDialogBox in WPF </title><link>http://www.intersoftsolutions.com/Community/ClientUI/Possible-bug-in-UXComboBox-and-UXDialogBox-in-WPF/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Possible bug in UXComboBox and UXDialogBox in WPF </title><link>http://www.intersoftsolutions.com/Community/ClientUI/Possible-bug-in-UXComboBox-and-UXDialogBox-in-WPF/</link><pubDate>Mon, 01 Jul 2013 07:54:37 GMT</pubDate><dc:creator>BillGower</dc:creator><description>&lt;p&gt;Thank you very much!!!! that works perfectly. Just another reason why Intersoft is the #1 .net controls provider. Not only is the product great and easy to use, the support is fantastic and fast.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Bill&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Possible bug in UXComboBox and UXDialogBox in WPF </title><link>http://www.intersoftsolutions.com/Community/ClientUI/Possible-bug-in-UXComboBox-and-UXDialogBox-in-WPF/</link><pubDate>Mon, 01 Jul 2013 07:09:04 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Thank you for the detail description regarding the reported problem.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I try to summarize the problem and come up with the following resume.&lt;/span&gt;&lt;/p&gt;
&lt;ul style="color: rgb(31, 73, 125);"&gt;&lt;li&gt;User opens up the second dialog box by clicking button on DialogBox1.&lt;/li&gt;&lt;li&gt;After DialogBox2 appear, user selects an item from UXComboBox.&lt;/li&gt;&lt;li&gt;MessagePresenter popup that says “Made it”, appear in the location as if the container is the DialogBox1 (which is not correct. It should be appearing on top of DialogBox2).&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;When a MessagePresenter is shown, the owner is defined by executing following line.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;FrameworkElement element = ISFocusManager.GetFocusedElement() as FrameworkElement;
// check if the caller is hosted within a known container
// if the dependency container is of IWindow type, use it as the owner of this modal window
if (element != null)
{
    DependencyObject logicalContainer = ISFocusManager.GetLogicalContainerScope(element);
    if (logicalContainer is IWindow)
        _owner = logicalContainer as IWindow;
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;The owner is determined by getting the focused element. In the above scenario, the focused element after user selects an item from UXComboBox is the scroll viewer of UXComboBox’s result box. However, this element does no longer exist in the view – just after user selects an item, the result box of UXComboBox is collapsed.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;It seems that when the focused element doesn’t exist in the view, GetLogicalContainerScope() method tries to look up from its parent. Please correct me if I’m wrong.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;So I created a workaround for such behavior. In the MessageBoxServiceProvider class, I added a setter for Owner property so that the Owner property now looks like following snippet code.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;public static IWindow Owner
{
    get
    {
        FrameworkElement element = ISFocusManager.GetFocusedElement() as FrameworkElement;
        // check if the caller is hosted within a known container
        // if the dependency container is of IWindow type, use it as the owner of this modal window
        if (element != null)
        {
            DependencyObject logicalContainer = ISFocusManager.GetLogicalContainerScope(element);
            if (logicalContainer is IWindow)
                _owner = logicalContainer as IWindow;
        }
        return _owner;
    }
    set { _owner = value; }
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;In DialogBox1EditViewModel class, I set the Owner property in AddAnotherDialogBox execute method as shown in the following snippet code.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;public void AddAnotherDialogBox(object parameter)
{
    var vm = new DialogBox2EditViewModel();
    DialogBoxServiceProvider.GetInstanceAsync(
        DialogBoxServiceProvider.DialogBox2EditView,
        dialogBox =&amp;gt;
        {
            dialogBox.DataContext = vm;
            MessageBoxServiceProvider.Owner = dialogBox;
            DialogBoxServiceProvider.Show(dialogBox, null);
        });
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;By using this workaround, now the MessagePresenter popup on top of the UXDialogBox2.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I enclosed the modified project as attachment. Please feel free to let me know if you have different result or if I mistakenly understanding about the reported problem.&lt;/span&gt;&lt;/p&gt;
</description></item><item><title>Possible bug in UXComboBox and UXDialogBox in WPF </title><link>http://www.intersoftsolutions.com/Community/ClientUI/Possible-bug-in-UXComboBox-and-UXDialogBox-in-WPF/</link><pubDate>Sun, 30 Jun 2013 11:35:40 GMT</pubDate><dc:creator>BillGower</dc:creator><description>&lt;p&gt;I have found the most peculiar bug when developing my WPF application and I am able to reproduce in the sample I am sending you. It occurs as follows:&lt;/p&gt;&lt;p&gt;Using the sample application built you click on contacts the contacts.xaml UXPage is displayed in the Content Panel. On the page is a dialog button that when clicked will display a dialog box called DialogBox1. On the dialog box is a UXComboBox which displays a list of products. If you click on an item in the combo box, it displays a MessagePresenter popup that says "Made it".  The Message box displays properly on top of dialog box but a breakpoint in the MessageBoxServiceProivder class at the following line says that the logical container of the Message box is MainPanel which is incorrect the logical container should be Dialog Box1&lt;/p&gt;&lt;pre style="background-color: white; font-family: consolas; font-size: 13px;"&gt;&lt;span style="color: rgb(43, 145, 175);"&gt;DependencyObject&lt;/span&gt;logicalContainer=&lt;span style="color: rgb(43, 145, 175);"&gt;ISFocusManager&lt;/span&gt;.GetLogicalContainerScope(element);
&lt;/pre&gt;
&lt;p&gt;I then placed a button on DialogBox1 which when clicked opens up a second dialog box. On this dialog box is the exact same combobox. When I click on an item I pop up a Message box saying "Made it". A breakpoint also says the logical container is MainPage which is incorrect it should now be DialogBox2. This time the Message box appears behind Dialog box2 which is wrong as it should appear on top of dialog box 2.&lt;/p&gt;
&lt;p&gt;If i place buttons on the dialog boxes and pop up a message when the buttons are clicked the logical container is correctly shown as the dialog box and the message box is correctly displayed on top of the appropriate dialog box. So there seems to be an issue with the UXComboBox and the Dialog box as to the logical container of the UXComboBox&lt;/p&gt;</description></item></channel></rss>