1

I have added a new dialog in my existing wpf application (say Myapplication.exe). My dialog name is MyDialog.

When executing Myapplication.exe, the application launches. It is working fine.

But after opening MyDialog, I found a MyDialog entry in Task manager -> Applications. If I close this dialog, it disappears.

I don't know what is happening? Please help.

Created dialog in visual studio using following steps:

Project property -> Add -> Add new item -> WPF -> User control (wpf).

However, under WPF, there is only one option "User Control(WPF)". There is no other options (like Page, Window). That is also strange.

Added code:

<base:WpfModalDialog x:Class="MapInfo.MiPro.MiTileServer.WMTSControl"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      mc:Ignorable="d" 
      Width="650" Height="600"
      xmlns:local="clr-namespace:MapInfo.MiPro.MiTileServer"
      Title="Open WMTS Table"
      xmlns:base="clr-namespace:MapInfo.MiPro.Base;assembly=mibase"
      d:DesignHeight="300" d:Des6ignWidth="300">
    <Grid>
    ....
    </Grid>
</base:WpfModalDialog>
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
user966379
  • 2,823
  • 3
  • 24
  • 30
  • 4
    do you have code for how you are creating the dialog window? – Kory Gill Jan 29 '16 at 07:11
  • Created dialog in visual studio using following steps: Project property->Add->Add new item ->WPF->User control (wpf). – user966379 Jan 29 '16 at 07:43
  • Which version of Windows is it? Application list works differently in Win7 and in Win8 and newer. – Shadowed Jan 29 '16 at 08:29
  • The missing templates might be caused by your project not being of WPF type. Check http://www.mztools.com/Articles/2008/MZ2008017.aspx to see, how you can edit your .csproj file in order to make it a WPF project. If your project type GUIDs do not contain the `{60DC8134-EBA5-43B8-BCC9-BB4BC16C2548}` GUID it is likely to be the cause for the missing templates. – David Jan 29 '16 at 08:30
  • 1
    "I don't know what is happening? Please help." This is not a valid question for StackOverflow. Can you please describe what you see as a problem and what is the expected behavior ? – Fab Jan 29 '16 at 08:58
  • please give the class "WpfModalDialog" here. also give the code where you are opening the dislodge something like show() or showdialohue(). – Kylo Ren Jan 29 '16 at 09:58

1 Answers1

1

I have not tested this but you might try setting the owner of your dialog window that I found suggested here.

If you try setting the Owner property of the windows you don't want to appear, then they won't be listed in the Task List. Only ownerless windows appear to get listed.

and they suggest as well

You can use ShowInTaskbar="False" in the window xaml file.

I also found a similar SO question that has been answered Stop windows from showing up as 'tasks' from task manager WPF c#.

Community
  • 1
  • 1
spacebread
  • 503
  • 7
  • 19