private void btnMenu_Click(object sender, RoutedEventArgs e)
        {
            switch (((Button)sender).Name)
            {
            case "btnWires": {
                WiresDirectory wires = new WiresDirectory(((AsdnRedSingleViewModel)DataContext).WireDirectory)
                {
                    Owner = this
                };
                wires.Show();
            }
            break;

            case "btnK2": {
                K2Directory k2 = new K2Directory()
                {
                    DataContext = DataContext,
                    Owner       = this
                };
                k2.Show();
            }
            break;

            case "btn_ρРУБ": {
                SteelPropertiesPartition propertiesPartition = new SteelPropertiesPartition()
                {
                    DataContext = DataContext,
                    Owner       = this
                };
                propertiesPartition.Show();
            }
            break;

            case "btn_p1050": {
                SteelPropertiesStator propertiesStator = new SteelPropertiesStator()
                {
                    DataContext = DataContext,
                    Owner       = this
                };
                propertiesStator.Show();
            }
            break;

            case "btnZ2": {
                Z2View z2View = new Z2View()
                {
                    DataContext = ((AsdnRedSingleViewModel)DataContext).Get_collectionZ2,
                    Owner       = this
                };
                z2View.CollectionIsZero.Content = ((AsdnSingleViewModel)DataContext).Get_collectionZ2.Z2.Count == 0 ? "нет данных" : string.Empty;
                z2View.Show();
            }
            break;

            case "btn_ImageStator": {
                string h2 = Math.Round(((AsdnRedSingleViewModel)DataContext).Model.Common.h2, 2).ToString();
                #region create windows
                #region first window
                List <ContentLabelImage> contentLabels = new List <ContentLabelImage> {
                    new ContentLabelImage("h1", ((AsdnRedSingleViewModel)DataContext).h1, "7", "350"),
                    new ContentLabelImage("h2", h2, "320", "200"),
                    new ContentLabelImage("h3", ((AsdnRedSingleViewModel)DataContext).h3, "335", "240"),
                    new ContentLabelImage("h4", ((AsdnRedSingleViewModel)DataContext).h4, "320", "350"),
                    new ContentLabelImage("h5", ((AsdnRedSingleViewModel)DataContext).h5, "335", "405"),
                    new ContentLabelImage("h6", ((AsdnRedSingleViewModel)DataContext).h6, "320", "442"),
                    new ContentLabelImage("h7", ((AsdnRedSingleViewModel)DataContext).h7, "335", "462"),
                    new ContentLabelImage("h8", ((AsdnRedSingleViewModel)DataContext).h8, "320", "505"),
                    new ContentLabelImage("ΔГ1", ((AsdnRedSingleViewModel)DataContext).ΔГ1, "17", "530"),
                    new ContentLabelImage("ac", ((AsdnRedSingleViewModel)DataContext).ac, "145", "507"),
                    new ContentLabelImage("bПН", ((AsdnRedSingleViewModel)DataContext).bПН, "145", "543"),
                    new ContentLabelImage("bП", ((AsdnRedSingleViewModel)DataContext).bП, "140", "8"),
                    new ContentLabelImage("bП1", ((AsdnRedSingleViewModel)DataContext).bП1, "145", "581")
                };
                ContentStatorImageControl contentStator = new ContentStatorImageControl(contentLabels)
                {
                    ImageSource = "pack://application:,,,/Resource/Stator1.JPG"
                };
                UserControlStatorImage statorImage1 = new UserControlStatorImage {
                    DataContext = contentStator
                };
                #endregion
                #region second window
                contentLabels = new List <ContentLabelImage> {
                    new ContentLabelImage("h1", ((AsdnRedSingleViewModel)DataContext).h1, "7", "350"),
                    new ContentLabelImage("h2", h2, "320", "200"),
                    new ContentLabelImage("h3", ((AsdnRedSingleViewModel)DataContext).h3, "335", "240"),
                    new ContentLabelImage("h4", ((AsdnRedSingleViewModel)DataContext).h4, "320", "350"),
                    new ContentLabelImage("h5", ((AsdnRedSingleViewModel)DataContext).h5, "335", "405"),
                    new ContentLabelImage("h6", ((AsdnRedSingleViewModel)DataContext).h6, "320", "445"),
                    new ContentLabelImage("h7", ((AsdnRedSingleViewModel)DataContext).h7, "335", "462"),
                    new ContentLabelImage("h8", ((AsdnRedSingleViewModel)DataContext).h8, "320", "510"),
                    new ContentLabelImage("ΔГ1", ((AsdnRedSingleViewModel)DataContext).ΔГ1, "17", "530"),
                    new ContentLabelImage("ac", ((AsdnRedSingleViewModel)DataContext).ac, "145", "510"),
                    new ContentLabelImage("bПН", ((AsdnRedSingleViewModel)DataContext).bПН, "145", "552"),
                    new ContentLabelImage("bП", ((AsdnRedSingleViewModel)DataContext).bП, "140", "5"),
                    new ContentLabelImage("d1", ((AsdnRedSingleViewModel)DataContext).d1, "145", "587")
                };
                contentStator = new ContentStatorImageControl(contentLabels)
                {
                    ImageSource = "pack://application:,,,/Resource/Stator2.jpg"
                };
                UserControlStatorImage statorImage2 = new UserControlStatorImage {
                    DataContext = contentStator
                };
                #endregion
                #region third window
                contentLabels = new List <ContentLabelImage> {
                    new ContentLabelImage("h1", ((AsdnRedSingleViewModel)DataContext).h1, "7", "350"),
                    new ContentLabelImage("h2", h2, "330", "210"),
                    new ContentLabelImage("h3", ((AsdnRedSingleViewModel)DataContext).h3, "315", "270"),
                    new ContentLabelImage("h4", ((AsdnRedSingleViewModel)DataContext).h4, "330", "380"),
                    new ContentLabelImage("h5", ((AsdnRedSingleViewModel)DataContext).h5, "315", "453"),
                    new ContentLabelImage("h6", ((AsdnRedSingleViewModel)DataContext).h6, "330", "497"),
                    new ContentLabelImage("h7", ((AsdnRedSingleViewModel)DataContext).h7, "315", "507"),
                    new ContentLabelImage("ac", ((AsdnRedSingleViewModel)DataContext).ac, "165", "516"),
                    new ContentLabelImage("bП", ((AsdnRedSingleViewModel)DataContext).bП, "140", "5"),
                    new ContentLabelImage("bП1", ((AsdnRedSingleViewModel)DataContext).bП1, "145", "558")
                };
                contentStator = new ContentStatorImageControl(contentLabels)
                {
                    ImageSource = "pack://application:,,,/Resource/Stator3.jpg"
                };
                UserControlStatorImage statorImage3 = new UserControlStatorImage {
                    DataContext = contentStator
                };
                #endregion
                #region fourth window
                contentLabels = new List <ContentLabelImage> {
                    new ContentLabelImage("h1", ((AsdnRedSingleViewModel)DataContext).h1, "7", "350"),
                    new ContentLabelImage("h2", h2, "330", "215"),
                    new ContentLabelImage("h3", ((AsdnRedSingleViewModel)DataContext).h3, "315", "270"),
                    new ContentLabelImage("h4", ((AsdnRedSingleViewModel)DataContext).h4, "330", "380"),
                    new ContentLabelImage("h5", ((AsdnRedSingleViewModel)DataContext).h5, "315", "455"),
                    new ContentLabelImage("h6", ((AsdnRedSingleViewModel)DataContext).h6, "330", "497"),
                    new ContentLabelImage("h7", ((AsdnRedSingleViewModel)DataContext).h7, "315", "507"),
                    new ContentLabelImage("ac", ((AsdnRedSingleViewModel)DataContext).ac, "170", "513"),
                    new ContentLabelImage("bП", ((AsdnRedSingleViewModel)DataContext).bП, "140", "10"),
                    new ContentLabelImage("d1", ((AsdnRedSingleViewModel)DataContext).d1, "155", "555")
                };
                contentStator = new ContentStatorImageControl(contentLabels)
                {
                    ImageSource = "pack://application:,,,/Resource/Stator4.jpg"
                };
                UserControlStatorImage statorImage4 = new UserControlStatorImage {
                    DataContext = contentStator
                };
                #endregion
                #endregion
                StatorsDirectory stators = new StatorsDirectory(statorImage1, statorImage2, statorImage3, statorImage4)
                {
                    Owner = this
                };
                stators.Show();
            }
            break;
            }
        }
Beispiel #2
0
 public StatorsDirectory(UserControlStatorImage statorImage1, UserControlStatorImage statorImage2, UserControlStatorImage statorImage3, UserControlStatorImage statorImage4)
 {
     StatorImage1 = statorImage1; StatorImage2 = statorImage2; StatorImage3 = statorImage3; StatorImage4 = statorImage4;
     InitializeComponent();
 }