当前位置: 首页>>代码示例>>C#>>正文


C# DockableContent.Show方法代码示例

本文整理汇总了C#中AvalonDock.DockableContent.Show方法的典型用法代码示例。如果您正苦于以下问题:C# DockableContent.Show方法的具体用法?C# DockableContent.Show怎么用?C# DockableContent.Show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AvalonDock.DockableContent的用法示例。


在下文中一共展示了DockableContent.Show方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BuildDockingLayout

        void BuildDockingLayout()
        {
            dockManager.Content = null;

            //TreeView dockable content
            var trv = new TreeView();
            trv.Items.Add(new TreeViewItem() { Header = "Item1" });
            trv.Items.Add(new TreeViewItem() { Header = "Item2" });
            trv.Items.Add(new TreeViewItem() { Header = "Item3" });
            trv.Items.Add(new TreeViewItem() { Header = "Item4" });
            ((TreeViewItem)trv.Items[0]).Items.Add(new TreeViewItem() { Header = "SubItem1" });
            ((TreeViewItem)trv.Items[0]).Items.Add(new TreeViewItem() { Header = "SubItem2" });
            ((TreeViewItem)trv.Items[1]).Items.Add(new TreeViewItem() { Header = "SubItem3" });
            ((TreeViewItem)trv.Items[2]).Items.Add(new TreeViewItem() { Header = "SubItem4" });
            var treeviewContent = new DockableContent() { Title = "Explorer", Content = trv };

            treeviewContent.Show(dockManager, AnchorStyle.Bottom);

            //TextBox invo dockable content
            var treeviewInfoContent = new DockableContent() { Title = "Explorer Info", Content = new TextBox() { Text = "Explorer Info Text", IsReadOnly = true } };
            treeviewContent.ContainerPane.Items.Add(treeviewInfoContent);

            //ListView dockable content
            var gridView = new GridView();
            gridView.Columns.Add(new GridViewColumn() { Header = "Date" });
            gridView.Columns.Add(new GridViewColumn() { Header = "Day Of Weeek", DisplayMemberBinding = new Binding("DayOfWeek") });
            gridView.Columns.Add(new GridViewColumn() { Header = "Year", DisplayMemberBinding = new Binding("Year") });
            gridView.Columns.Add(new GridViewColumn() { Header = "Month", DisplayMemberBinding = new Binding("Month") });
            gridView.Columns.Add(new GridViewColumn() { Header = "Second", DisplayMemberBinding = new Binding("Second") });
            var listView = new ListView() { View = gridView };
            listView.Items.Add(DateTime.Now);
            listView.Items.Add(DateTime.Now.AddYears(-1));
            listView.Items.Add(DateTime.Now.AddMonths(15));
            listView.Items.Add(DateTime.Now.AddHours(354));

            var listViewContent = new DockableContent() { Title = "Date & Times", Content = listView };
            listViewContent.ShowAsFloatingWindow(dockManager, true);

            //TextBox dockable content
            var textboxSampleContent = new DockableContent() { Title = "Date & Times Info", Content = new TextBox() { Text = "Date & Times Info Text", IsReadOnly = true } };
            listViewContent.ContainerPane.Items.Add(textboxSampleContent);

            //DataGrid document
            //var dataGrid = new DataGrid();
            //var rnd = new Random();
            //var data = new List<Tuple<double, double, double, double>>();
            //for (int i = 0; i < 100; i++)
            //{
            //    data.Add(Tuple.Create(rnd.NextDouble(), rnd.NextDouble() * 10.0, rnd.NextDouble() * 100.0, rnd.NextDouble() * 1000.0));
            //}

            //dataGrid.ItemsSource = data;

            //var dataGridDocument = new DocumentContent() { Title = "Data", IsLocked = true, Content = dataGrid };
            //dataGridDocument.Show(dockManager);

            ////DataGrid Info Text sample
            //var dataGridInfoContent = new DockableContent() { Title = "Data Info", Content = new TextBox() { Text = "Data Info Text" } };
            //dataGridInfoContent.ShowAsDocument(dockManager);
        }
开发者ID:JeremyDurnell,项目名称:ChromeTabs,代码行数:60,代码来源:MainWindow.xaml.cs

示例2: BuildDockingLayout

        void BuildDockingLayout()
        {
            dockManager.Content = null;

            trv = new System.Windows.Controls.TreeView();
            TreeViewItem tvitem = GetTreeView("recorded_vid", "Recorded Video", @"C:\Users\UA\Documents\Project\Displayer\P001DS004Tvs2012\Icon\Video Call-50.png");
            trv.Items.Add(tvitem);
            foreach(var video in dbController.list_video()){
                ((TreeViewItem)trv.Items[0]).Items.Add(new TreeViewItem() { Header = video });
            }
            trv.MouseDoubleClick += trv_NodeMouseDoubleClick;

            var treeviewContent_right = new DockableContent() { Title = "Video Lists", Content = trv };
            treeviewContent_right.Show(dockManager, AnchorStyle.Right);

            var treeviewContent_left = new DockableContent() { Title = "Device Lists", Content = new System.Windows.Controls.TextBox() { Text = "Device Lists", IsReadOnly = true } };
            treeviewContent_left.Show(dockManager, AnchorStyle.Left);
            treeviewContent_left.ToggleAutoHide();

            videoPanel.ShowAsDocument(dockManager);
        }
开发者ID:potmadu,项目名称:P001DS004Tvs2012,代码行数:21,代码来源:MainWindow.xaml.cs

示例3: ShowDockable

 public static void ShowDockable(DockableContent doc)
 {
     doc.Show(DockingManager);
     doc.Activate();
 }
开发者ID:HaKDMoDz,项目名称:Irelia,代码行数:5,代码来源:DocumentService.cs

示例4: AddDockablePane

 /// <summary>
 /// Adds a new side menu window
 /// </summary>
 /// <param name="title">The title of the side menu.</param>
 /// <param name="control">The control that will be inserted into the side menu.</param>
 public void AddDockablePane(string title, UserControl control)
 {
     var dockable = new DockableContent()
     {
         Title = title,
         Content = control,
         IsCloseable = false,
         DockableStyle = DockableStyle.AutoHide,
     };
     dockable.Show(this.dockManger);
 }
开发者ID:seniorOtaka,项目名称:ndoctor,代码行数:16,代码来源:MainWindow.xaml.cs

示例5: ShowWindow

        /// <summary>
        /// Shows a docking window for a given view.  
        /// If is has been shown before, restore it position. Otherwise dock it to the right side.
        /// </summary>
        /// <param name="view">View to dock.</param>
        /// <param name="dockingStyle">Docking style.</param>
        /// <param name="dockingAnchorStyle">Docking anchor style. Only usefull for DockingPaneStyle.Docked.</param>
        public void ShowWindow(IDockableViewModel view, DockingPaneStyle dockingStyle, DockingPaneAnchorStyle dockingAnchorStyle)
        {
            // init resource dictionaries for plugin hosters
            if (view is IPluginHosterViewModel)
            {
                IPluginHosterViewModel pHost = (IPluginHosterViewModel)view;
                if (pHost.IsVMPlugin)
                {
                    if (!pHost.VMPluginDictionaryInitialized)
                        try
                        {
                            if (pHost.VMPlugin.GetViewModelRessourceDictionary() != null)
                                if (System.Windows.Application.Current != null)
                                {
                                    System.Windows.Application.Current.Resources.BeginInit();
                                    System.Windows.Application.Current.Resources.MergedDictionaries.Add(pHost.VMPlugin.GetViewModelRessourceDictionary());
                                    System.Windows.Application.Current.Resources.EndInit();
                                }
                            pHost.VMPluginDictionaryInitialized = true;
                        }
                        catch
                        {
                            pHost.VMPluginDictionaryInitialized = false;
                        }
                }
            }
            if (!this.isRestoringLayout)
            {
                if (!view.IsInitialized)
                    view.InitializeVM();

                if (view is IRibbonDockableViewModel && this.Ribbon != null)
                    if (!((IRibbonDockableViewModel)view).IsRibbonMenuInitialized)
                    {
                        ((IRibbonDockableViewModel)view).CreateRibbonMenu(this.Ribbon);
                    }
            }

            if (!viewLookup.ContainsKey(view.DockingPaneName))
            {
                DockableContent content = new DockableContent();
                content.Name = view.DockingPaneName;
                content.Title = view.DockingPaneTitle;
                content.Content = view;
                content.StateChanged += new System.Windows.RoutedEventHandler(content_StateChanged);
                if (view.ActivationMode == ActivationMode.Normal)
                    content.IsActiveContentChanged += new EventHandler(content_IsActiveContentChanged);
                content.ContextChangeKind = ConvertToContextChangeKind(view.DockingContextChangeKind);

                viewLookup.Add(view.DockingPaneName, new ViewLookUp(view, content));
                
                if (this.isRestoringLayout)
                {
                    this.MainDockingManager.AddPaneForLayoutRestore(content);
                }
                else
                {
                    if (dockingStyle == DockingPaneStyle.Floating)
                    {
                        content.FloatingWindowSize = new Size(view.FloatingWindowDesiredWidth, view.FloatingWindowDesiredHeight);
                        content.ShowAsFloatingWindow(this.MainDockingManager, true);
                    }
                    else if (dockingStyle == DockingPaneStyle.DockedInDocumentPane)
                        content.ShowAsDocument(this.MainDockingManager);
                    else
                    {
                        if (view.DockedWindowDesiredWidth > 0)
                            content.DesiredWidth = view.DockedWindowDesiredWidth;
                        if (view.DockedWindowDesiredHeight > 0)
                            content.DesiredHeight = view.DockedWindowDesiredHeight;

                        AnchorStyle style = ConvertToAnchorStyle(dockingAnchorStyle);
                        if (style != AnchorStyle.None)
                        {
                            content.Show(this.MainDockingManager, style);
                        }
                        else
                            content.Show(this.MainDockingManager);
                    }
                }
            }

            // show docking window
            if (!this.isRestoringLayout)
            if (!viewLookup[view.DockingPaneName].Pane.IsVisible)
            {
                if (dockingStyle == DockingPaneStyle.Floating)
                {
                    viewLookup[view.DockingPaneName].Pane.FloatingWindowSize = new Size(view.FloatingWindowDesiredWidth, view.FloatingWindowDesiredHeight);
                    viewLookup[view.DockingPaneName].Pane.ShowAsFloatingWindow(this.MainDockingManager, true);
                }
                else if (dockingStyle == DockingPaneStyle.DockedInDocumentPane)
                    viewLookup[view.DockingPaneName].Pane.ShowAsDocument(this.MainDockingManager);
//.........这里部分代码省略.........
开发者ID:apoorv-vijay-joshi,项目名称:FSE-2011-PDE,代码行数:101,代码来源:DockingLayoutManager.cs

示例6: BuildDockingLayout

        /// <summary>
        /// Initialise the proprety dock (dockManager of AvalonDock)
        /// </summary>
        void BuildDockingLayout()
        {
            dockManager.Content = null;

            // The name properties are needed to save and restore the layout
            dockManager.Name = "dockManagerName";

            BitmapImage propertiesIcon = new BitmapImage();
            propertiesIcon.BeginInit();
            propertiesIcon.UriSource = new Uri(@"/images/Properties_Icon.png", UriKind.RelativeOrAbsolute);
            propertiesIcon.EndInit();

            BitmapImage eventsIcon = new BitmapImage();
            eventsIcon.BeginInit();
            eventsIcon.UriSource = new Uri(@"/images/event.png", UriKind.RelativeOrAbsolute);
            eventsIcon.EndInit();

            dockableComponentProperties = new DockableContent() {
                Title = Properties.Resources.DockProperties,
                Content = null,
                Name = "dockComponentName",
                Icon = propertiesIcon
            };

            propertyDockScrollViewer = new ScrollViewer();
            propertyDockScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            propertyDockScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;

            StackPanel sp = new StackPanel();
            dockableComponentProperties.Content = sp;
            sp.Children.Add(propertyDockScrollViewer);
            dockableComponentProperties.Show(dockManager, AnchorStyle.Right);
            dockableComponentProperties.IsCloseable = false;

            scrollCanvars = new DocumentContent() {
                Title = Properties.Resources.DockMainWindow,
                Content = scrollViewer,
                Name = "dockDeploymentWindowName"
            };
            scrollCanvars.IsCloseable = false;
            scrollCanvars.Show(dockManager);

            // creating the tab for the gui designer
            InitGUITab();

            //TreeView dockable content
            dockableInportsList = new TreeView();
            BrushConverter bc = new BrushConverter();
            dockableInportsList.Background = (Brush)bc.ConvertFrom("#FFFFFFFF");
            dockableInportsList.IsTabStop = true;
            //dockableInportsList.Background = (Brush)bc.ConvertFrom("#FFE9ECFA");
            dockableOutportsList = new TreeView();
            dockableOutportsList.Background = (Brush)bc.ConvertFrom("#FFFFFFFF");
            //dockableOutportsList.Background = (Brush)bc.ConvertFrom("#FFE9ECFA");

            dockableInportsTab = new DockableContent() {
                Title = Properties.Resources.DockInPorts,
                Content = dockableInportsList,
                Visibility = Visibility.Collapsed,
                Name = "inputPortsName",
                Icon = propertiesIcon,
                IsCloseable = false
            };
            dockableOutportsTab = new DockableContent() {
                Title = Properties.Resources.DockOutPorts,
                Content = dockableOutportsList,
                Visibility = Visibility.Collapsed,
                Name = "outputPortsName",
                Icon = propertiesIcon,
                IsCloseable = false
            };

            // EventListenerGrid
            eventListenerDockScrollViewer = new ScrollViewer();
            eventListenerDockScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            eventListenerDockScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            dockableEventListenerTab = new DockableContent() {
                Title = Properties.Resources.PropertyDockEventListenerTab,
                Content = eventListenerDockScrollViewer,
                Visibility = Visibility.Collapsed,
                Name = "eventListenerName",
                Icon = eventsIcon,
                IsCloseable = false
            };
            eventListenerDockScrollViewer.SizeChanged += dockableEventListenerTriggerTab_SizeChanged;

            // EventTriggerGrid
            eventTriggerDockScrollViewer = new ScrollViewer();
            eventTriggerDockScrollViewer.HorizontalScrollBarVisibility = ScrollBarVisibility.Auto;
            eventTriggerDockScrollViewer.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            dockableEventTriggerTab = new DockableContent() {
                Title = Properties.Resources.PropertyDockEventTriggerTab,
                Content = eventTriggerDockScrollViewer,
                Visibility = Visibility.Collapsed,
                Name = "eventTriggerName",
                Icon = eventsIcon,
                IsCloseable = false
//.........这里部分代码省略.........
开发者ID:Walid-Shouman,项目名称:AsTeRICS,代码行数:101,代码来源:MainWindow.xaml.cs

示例7: SetVisibilityOfMenuItems

 private void SetVisibilityOfMenuItems(DockableContent dc)
 {
     if (dc.Visibility == Visibility.Visible) // the value is set in ConvertBack of AvalonDockVisibilityConverter!!!
     {
         dc.Show();
     }
     else
     {
         dc.Hide();
     }
 }
开发者ID:MartyIX,项目名称:SoTh,代码行数:11,代码来源:ViewMenuClicks.cs


注:本文中的AvalonDock.DockableContent.Show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。