コード例 #1
0
        public ToolsViewModel(GameInformationViewModel rpOwner)
        {
            r_Owner = rpOwner;

            r_OpenToolPaneCommand = new DelegatedCommand <ToolViewModel>(r_Owner.AddTabItem);
            ToolPanes             = PluginService.Instance.ToolPanes?.Select(r =>
            {
                ToolViewModel rResult;

                var rScrollBarVisibilities = r as IToolPaneScrollBarVisibilities;
                if (rScrollBarVisibilities == null)
                {
                    rResult = new ToolWithoutScrollBarViewModel(r)
                    {
                        OpenCommand = r_OpenToolPaneCommand
                    }
                }
                ;
                else
                {
                    rResult = new ToolWithScrollBarViewModel(r, rScrollBarVisibilities)
                    {
                        OpenCommand = r_OpenToolPaneCommand
                    }
                };

                return(rResult);
            }).ToArray();
        }
コード例 #2
0
        public ToolsViewModel(GameInformationViewModel rpOwner)
        {
            r_Owner = rpOwner;

            r_OpenToolPaneCommand = new DelegatedCommand<ToolViewModel>(r_Owner.AddTabItem);
            ToolPanes = PluginService.Instance.ToolPanes?.Select(r =>
            {
                ToolViewModel rResult;

                var rScrollBarVisibilities = r as IToolPaneScrollBarVisibilities;
                if (rScrollBarVisibilities == null)
                    rResult = new ToolWithoutScrollBarViewModel(r) { OpenCommand = r_OpenToolPaneCommand };
                else
                    rResult = new ToolWithScrollBarViewModel(r, rScrollBarVisibilities) { OpenCommand = r_OpenToolPaneCommand };

                return rResult;
            }).ToArray();
        }