using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows.Forms; namespace BlogViewModel { public partial class FormMain : Form { public FormMain() { InitializeComponent(); } private void пользователиToolStripMenuItem_Click(object sender, EventArgs e) { var service = Program.ServiceProvider?.GetService(typeof(FormUsers)); if (service is FormUsers form) { form.ShowDialog(); } } } }