コード例 #1
0
        /// <summary>
        /// Method used for changing the Layout for the MDI elements.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Layout_Click(object sender, RoutedEventArgs e)
        {
            //Changing Document Containter Layout
            Button c = (Button)sender;
            string g = c.Content.ToString();

            switch (c.Name)
            {
            case "Cascade":
                DocContainer.SetLayout(MDILayout.Cascade);
                DocumentContainer.SetCanDrag(firstdoc, true);
                DocumentContainer.SetCanDrag(seconddoc, true);
                DocumentContainer.SetCanDrag(ThirdDoc, true);
                break;

            case "THorizontal":
                DocContainer.SetLayout(MDILayout.Horizontal);
                DocumentContainer.SetCanDrag(firstdoc, false);
                DocumentContainer.SetCanDrag(seconddoc, false);
                DocumentContainer.SetCanDrag(ThirdDoc, false);
                break;

            case "TVertical":
                DocContainer.SetLayout(MDILayout.Vertical);
                DocumentContainer.SetCanDrag(firstdoc, false);
                DocumentContainer.SetCanDrag(seconddoc, false);
                DocumentContainer.SetCanDrag(ThirdDoc, false);
                break;
            }
        }
コード例 #2
0
ファイル: Window1.xaml.cs プロジェクト: MuthusamyPonraj/WPF
        /// <summary>
        /// Method used for changing the Layout for the MDI elements.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Layout_Click(object sender, RoutedEventArgs e)
        {
            //Changing Document Containter Layout
            MenuItem c = (MenuItem)sender;
            string   g = c.Header.ToString();

            switch (c.Name)
            {
            case "Cascade":
                DocContainer.SetLayout(MDILayout.Cascade);
                break;

            case "THorizontal":
                DocContainer.SetLayout(MDILayout.Horizontal);
                break;

            case "TVertical":
                DocContainer.SetLayout(MDILayout.Vertical);
                break;
            }
        }