Window.Show () Do not show Windows

I have a little problem creating a new window. The weird part is that the window is being created, but calling .Show() or .Activate() does nothing.

The code I use to create the window is:

 TicketView tv = new TicketView(); tv.Activate(); 

At first, I tried to set the window data context at the same time, but I realized this, but I still see the same behavior. No matter what the code is at this time. If anyone has any ideas, I would be very grateful!

For reference, this is a type of XAML ticket.

 <Window x:Class="Helpdesk.View.TicketView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="TicketView" Height="300" Width="300"> <Grid> </Grid> </Window> 
+6
source share
1 answer

It depends on what you are trying to do. What I have done in the past, if this is my main window, is to use the Application.Run method. If I try to launch another window from my application, I use the ShowDialog method.

0
source

Source: https://habr.com/ru/post/896598/


All Articles