locked
How to set Dialog Visible always when obscured by foreground window is minimised/closed RRS feed

  • Question

  •  

    Hi All,

    In WPF application, I want to set dialog property to be always present in background(windowA), even though it is obscured by some other window in the foreground, Once the foreground window is closed (windowB) the background windowA should be visible, and hence, I had made following code changes to WPF XAML code

     

    Xaml code for WindowA


      

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"


      

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Window x:Class="UI.Windows.WindowA"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

    Title="windowA"  Height="410" Width="468" WindowStyle="SingleBorderWindow" ResizeMode="NoResize" Visibility="Visible" WindowStartupLocation="CenterScreen" IsTabStop="True" Background="#E8EDF0" KeyUp="Window_KeyUp">

    ...............

       

    in WindowsA.Xaml.cs file

    ...... 

    publicVisibilityVisibility { get; set; }

    ......

    I get the below error on compilation, even though all namespaces are mentioned.

    error MC3029: 'Visibility' member is not valid because it does not have a qualifying type name

    Details: Windows 7 O/S, VS 2010 IDE

    Any help in resolving the above would be much appreciable,

    Regards,

    VishalK_90



    • Edited by VishaK_90 Wednesday, July 17, 2013 1:33 PM
    Wednesday, July 17, 2013 1:31 PM

Answers

  • The built-in System.Windows.Window class already has a Visibility property of enumeration type System.Windows.Visibility so you don't need to define another one in your code-behind file, assumed that your window inherits from the System.Windows.Window class.
    • Marked as answer by Lisa Zhu Saturday, July 27, 2013 7:11 AM
    Wednesday, July 17, 2013 2:15 PM