public MainWindowViewModel(IContainerExtension container, IRegionManager regionManager, MyImage myImage)
        {
            LoadImageCommand.Subscribe(x => myImage.LoadImage());

            DropEvent.Select(x => x?.FirstOrDefault()?.LocalPath).Where(x => x != null)
            .Subscribe(x => myImage.LoadImage(x));
        }
Esempio n. 2
0
 public PopupPageNavigationService(IPopupNavigation popupNavigation, IContainerExtension container,
                                   IApplicationProvider applicationProvider, IPageBehaviorFactory pageBehaviorFactor,
                                   ILoggerFacade logger)
     : base(container, applicationProvider, pageBehaviorFactor, logger)
 {
     _popupNavigation = popupNavigation;
 }
Esempio n. 3
0
 public PageNavigationService(IContainerExtension container, IApplicationProvider applicationProvider, IPageBehaviorFactory pageBehaviorFactory, ILoggerFacade logger)
 {
     _container           = container;
     _applicationProvider = applicationProvider;
     _pageBehaviorFactory = pageBehaviorFactory;
     _logger = logger;
 }
        public ImageScrollViewerViewModel(IContainerExtension container, IRegionManager regionManager, MyImage myImage)
        {
            ImageSource = myImage.ObserveProperty(x => x.ImageSource).ToReadOnlyReactiveProperty(mode: ReactivePropertyMode.None);

            // ズーム倍率のデバッグ表示
            ImageZoomPayload
            .Subscribe(x => Console.WriteLine($"VM-ZoomMagRatio: {x.IsEntire} => {(x.MagRatio * 100.0):f2} %"));

            // スクロール位置のデバッグ表示
            ImageScrollOffsetCenter
            .Subscribe(x => Console.WriteLine($"VM-ScrollOffsetRatio: {x.Width:f2} x {x.Height:f2}"));


            ZoomAllCommand
            .Subscribe(x =>
            {
                // 全画面の再要求を行うと、Viewで設定した倍率をクリアしてしまうので行わない
                if (!ImageZoomPayload.Value.IsEntire)
                {
                    ImageZoomPayload.Value = new ImageZoomPayload(true, double.NaN);
                }
            });

            ZoomX1Command
            .Subscribe(x => ImageZoomPayload.Value = new ImageZoomPayload(false, 1.0));

            OffsetCenterCommand
            .Subscribe(x => ImageScrollOffsetCenter.Value = new Size(0.5, 0.5));
        }
        private void InternalInitialize()
        {
            // don't forget there is no logger yet
            if (_logStartingEvents)
            {
                _logger.Log($"{nameof(PrismApplicationBase)}.{nameof(InternalInitialize)}", Category.Info, Priority.None);
            }

            // dependecy injection
            _containerExtension = CreateContainerExtension();
            RegisterRequiredTypes(_containerExtension as IContainerRegistry);

            Debug.WriteLine("[App.RegisterTypes()]");
            RegisterTypes(_containerExtension as IContainerRegistry);

            Debug.WriteLine("Dependency container has just been finalized.");
            _containerExtension.FinalizeExtension();

            // now we can start logging instead of debug/write
            _logger = Container.Resolve <ILoggerFacade>();

            // finalize the application
            ConfigureViewModelLocator();

            ConfigureModuleCatalog(Container.Resolve <IModuleCatalog>());
            InitializeModules();
        }
Esempio n. 6
0
        /// <summary>
        /// Runs the initialization sequence to configure the Prism application.
        /// </summary>
        protected virtual void Initialize()
        {
            ContainerLocator.SetContainerExtension(CreateContainerExtension);
            _containerExtension = ContainerLocator.Current;
            _moduleCatalog      = CreateModuleCatalog();
            RegisterRequiredTypes(_containerExtension);
            RegisterTypes(_containerExtension);
            _containerExtension.FinalizeExtension();

            ConfigureModuleCatalog(_moduleCatalog);

            var regionAdapterMappings = _containerExtension.Resolve <RegionAdapterMappings>();

            ConfigureRegionAdapterMappings(regionAdapterMappings);

            var defaultRegionBehaviors = _containerExtension.Resolve <IRegionBehaviorFactory>();

            ConfigureDefaultRegionBehaviors(defaultRegionBehaviors);

            RegisterFrameworkExceptionTypes();

            var shell = CreateShell();

            if (shell != null)
            {
                MvvmHelpers.AutowireViewModel(shell);
                RegionManager.SetRegionManager(shell, _containerExtension.Resolve <IRegionManager>());
                RegionManager.UpdateRegions();
                InitializeShell(shell);
            }

            InitializeModules();
        }
Esempio n. 7
0
        /// <summary>
        /// Runs the initialization sequence to configure the Prism application.
        /// </summary>
        public virtual void Initialize()
        {
            _containerExtension = CreateContainerExtension();
            _moduleCatalog      = CreateModuleCatalog();
            RegisterRequiredTypes(_containerExtension);
            RegisterTypes(_containerExtension);
            _containerExtension.FinalizeExtension();

            ConfigureServiceLocator();

            ConfigureModuleCatalog(_moduleCatalog);

            var regionAdapterMappins = _containerExtension.Resolve <RegionAdapterMappings>();

            ConfigureRegionAdapterMappings(regionAdapterMappins);

            var defaultRegionBehaviors = _containerExtension.Resolve <IRegionBehaviorFactory>();

            ConfigureDefaultRegionBehaviors(defaultRegionBehaviors);

            RegisterFrameworkExceptionTypes();

            var shell = CreateShell();

            if (shell != null)
            {
                RegionManager.SetRegionManager(shell, _containerExtension.Resolve <IRegionManager>());
                RegionManager.UpdateRegions();
                InitializeShell(shell);
                InitializeModules();
            }
        }
Esempio n. 8
0
        public StatusViewModel(IContainerExtension container, IEventAggregator eventAggregator)
        {
            _appData         = container.Resolve <AppData>();
            _eventAggregator = eventAggregator;

            DownloadCommand = new DelegateCommand(Download);

            _processStatuses = new HashSet <ProcessStatus>();

            _eventAggregator.GetEvent <ProcessStatusEvent>().Subscribe(OnProcessStatus, ThreadOption.BackgroundThread);
            _eventAggregator.GetEvent <CaretPositionEvent>().Subscribe(OnCaretPosition, ThreadOption.BackgroundThread);


            Task.Run(async() =>
            {
                try
                {
                    var urlString = @"https://api.github.com/repos/huangjia2107/xamlviewer/releases/latest";

                    var responseStr = await HttpUtil.GetString(urlString);

                    if (!string.IsNullOrEmpty(responseStr))
                    {
                        ReleaseVersion = JsonUtil.DeserializeObject <ReleaseInfo>(responseStr);
                    }
                }
                catch (Exception ex)
                {
                    Trace.TraceError("[ Http GetString ] " + Common.GetExceptionStringFormat(ex));
                }
            });
        }
        public MainWindow(IContainerExtension container, IRegionManager regionManager) : this()
        {
            _container     = container;
            _regionManager = regionManager;

            this.Activated += MainWindow_Activated;
        }
        public MainImageViewModel(IContainerExtension container, IRegionManager regionManager)
        {
            _container     = container;
            _regionManager = regionManager;

            ImageSource = MainImage
                          .ObserveProperty(x => x.ImageSource)
                          .ToReadOnlyReactiveProperty();

            ImageSource.Subscribe(x => InspectLinePoints.SetSourceSize(x.PixelWidth, x.PixelHeight));

            // Viewの非表示時のクリア
            LineLevels.ObserveProperty(x => x.IsShowingView).Where(b => !b)
            .Subscribe(_ =>
            {
                InspectLinePoints.ClearPoints();        // 画像上のLine表示
                LineLevels.ReleaseLinePoints();         // OxyPlot図(次回表示用)
            });

            // マウス移動開始
            MouseDown.Where(_ => LineLevels.IsShowingView)
            .Subscribe(p => InspectLinePoints.SetPoint1(p.X, p.Y));

            // マウス移動中
            var mouseMove = MouseDown.Merge(MouseDown.SelectMany(MouseMove.TakeUntil(MouseUp)))
                            .Where(_ => LineLevels.IsShowingView);

            // ViewのLine表示は常時更新
            mouseMove.Subscribe(p => InspectLinePoints.SetPoint2(p.X, p.Y));

            // Line画素値の取得は重いので計算を間引く
            mouseMove
            .Throttle(TimeSpan.FromMilliseconds(500))     // 指定期間分だけ値が通過しなかったら最後の一つを流す
            .Subscribe(_ => LineLevels.SetLinePointsRatio(InspectLinePoints.GetPointsRatio()));
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="RegionNavigationService"/> class.
 /// </summary>
 /// <param name="container">The <see cref="IContainerExtension" />.</param>
 /// <param name="regionNavigationContentLoader">The navigation target handler.</param>
 /// <param name="journal">The journal.</param>
 public RegionNavigationService(IContainerExtension container, IRegionNavigationContentLoader regionNavigationContentLoader, IRegionNavigationJournal journal)
 {
     _container = container ?? throw new ArgumentNullException(nameof(container));
     _regionNavigationContentLoader = regionNavigationContentLoader ?? throw new ArgumentNullException(nameof(regionNavigationContentLoader));
     Journal = journal ?? throw new ArgumentNullException(nameof(journal));
     Journal.NavigationTarget = this;
 }
Esempio n. 12
0
 public ContentViewModel(IContainerExtension container)
 {
     _eventAggregator = container.Resolve <IEventAggregator>();
     _service         = container.Resolve <IRestConsumingService <T> >();
     _mapper          = container.Resolve <IMapper>();
     StartLoadList();
 }
Esempio n. 13
0
        public SettingViewModel(IContainerExtension container, IRegionManager regionManager)
        {
            _container     = container;
            _regionManager = regionManager;

            ThingChangedCommand = new DelegateCommand <SelectionChangedEventArgs>(OnThingChanged);
        }
Esempio n. 14
0
        //If you want your own splash window - inherit from the bootstrapper and register type ISplashView
        protected override void InitializeModules()
        {
            IContainerExtension container = CreateContainerExtension();

            ModuleCatalog.Initialize();

            // Check for existance, make sure we init first.
            // load from disk in case of it not showing up in module catalog.
            // resolving seems to init properly.
            if (System.IO.File.Exists("Wider.Splash.dll"))
            {
                // Assume exits
                Assembly assembly = Assembly.LoadFrom("Wider.Splash.dll");
                Type     type     = assembly.GetType("Wider.Splash.SplashModule");
                IModule  splash   = (IModule)Container.Resolve(type);
                splash.OnInitialized(container);
            }

            // Load core module, this is internal so call manually
            CoreModule coreModule = Container.Resolve <CoreModule>();

            coreModule.OnInitialized(container);

            base.InitializeModules();

            // now we should have a shell, load settings and show if we can.
            IShell shell = Container.Resolve <IShell>();

            coreModule.LoadSettings();

            // Assign main window object and show window.
            Application.Current.MainWindow             = shell as Window;
            Application.Current.MainWindow.DataContext = Container.Resolve <IWorkspace>();
            Application.Current.MainWindow.Show();
        }
Esempio n. 15
0
        public static INavigationService CreateNavigationService(this IContainerExtension containerExtension, Page page)
        {
            var navigationService = containerExtension.Resolve <INavigationService>(PrismApplicationBase.NavigationServiceName);

            ((IPageAware)navigationService).Page = page;
            return(navigationService);
        }
        public DirectoryPathNodeViewModel(IContainerExtension container)
        {
            var modelMaster = container.Resolve <ModelMaster>();

            // 子ディレクトリを持つか(末端ディレクトリ)フラグ
            HasChildDirectory = TargetDirectoryNode
                                .Where(x => x != null)
                                .Select(x => x.HasChildDirectory())
                                .ToReadOnlyReactiveProperty();

            // 対象ディレクトリ内のディレクトリ
            ChildDirectoryNodes = TargetDirectoryNode
                                  .Where(x => x != null)
                                  .Select(x => x.GetChildDirectoryNodes())
                                  .SelectMany(x => x)
                                  .ToReactiveCollection();

            // Viewからのディレクトリ選択コンボボックス
            SelectedDirectoryNode
            .Where(x => x != null)
            .Select(x => DirectoryNode.GetExistsDirectoryPath(x.FullPath))
            .Do(path => modelMaster.TargetDirectoryPath = path)         // 選択結果を通知
            .Subscribe(x => SelectedDirectoryNode.Value = null);        // 通知したら空に戻す(値保持しない)

            // ディレクトリ選択ボタン
            SelectDirectoryCommand
            .Where(x => x != null)
            .Cast <DirectoryNode>()
            .Select(x => DirectoryNode.GetExistsDirectoryPath(x.FullPath))
            .Subscribe(path => modelMaster.TargetDirectoryPath = path);
        }
Esempio n. 17
0
        public MainWindowViewModel(
            IEventAggregator eventAggregator,
            IModuleManager moduleManager,
            IContainerExtension container,
            IRegionManager regionManager)
        {
            _eventAggregator = eventAggregator;
            _moduleManager   = moduleManager;
            _container       = container;
            _regionManager   = regionManager;

            BitMasks = new ObservableCollection <BitMaskInfo>()
            {
                new BitMaskInfo()
                {
                    Key = "A", IsEnable = true
                },
                new BitMaskInfo()
                {
                    Key = "B", IsEnable = false
                },
            };

            BindingCommand = new DelegateCommand(() =>
            {
                Title = "Command";
            });

            Title = "Init";
        }
Esempio n. 18
0
        public MainViewModel(IContainerExtension container, IApplicationCommands appCommands)
        {
            _appData    = container.Resolve <AppData>();
            AppCommands = appCommands;

            InitCommand();
        }
        private void InternalInitialize()
        {
            // don't forget there is no logger yet
            if (_logStartingEvents)
            {
                _logger.Log($"{nameof(ApplicationTemplate)}.{nameof(InternalInitialize)}", Category.Info, Priority.None);
            }

            // dependecy injection
            _containerExtension = CreateContainerExtension();
            if (_containerExtension is IContainerRegistry registry)
            {
                registry.RegisterSingleton <ILoggerFacade, DebugLogger>();
                registry.RegisterSingleton <IEventAggregator, EventAggregator>();
                RegisterInternalTypes(registry);
            }

            Debug.WriteLine("[App.RegisterTypes()]");
            RegisterTypes(_containerExtension as IContainerRegistry);

            Debug.WriteLine("Dependency container has just been finalized.");
            _containerExtension.FinalizeExtension();

            // now we can start logging instead of debug/write
            _logger = Container.Resolve <ILoggerFacade>();

            // finalize the application
            ConfigureViewModelLocator();
        }
Esempio n. 20
0
 public ShellPrismNavigationService(
     IContainerExtension containerExtension,
     IPageBehaviorFactory pageBehaviorFactory)
 {
     _container           = containerExtension;
     _pageBehaviorFactory = pageBehaviorFactory;
 }
        /// <summary>
        /// コンストラクタ
        /// 引数を追加することによりPrismに対して各インスタンスを要求しています。
        /// CommonDatasは、App.xaml.csのRegisterTypesにて登録されます。
        /// </summary>
        /// <param name="container">拡張コンテナを設定します。</param>
        /// <param name="regionManager">リージョンマネージャを設定します。</param>
        /// <param name="eventAggregator">イベントアグリゲータを設定します。</param>
        /// <param name="commonSettings">共通設定を設定します。</param>
        /// <param name="commonDatas">共通データを設定します。</param>
        /// <param name="mainViewName">MainViewNameを設定します。</param>
        /// <param name="viewName">ViewNameを設定します。</param>
        protected BindableBasePlus(
            [param: Required] IContainerExtension container,
            [param: Required] IRegionManager regionManager,
            [param: Required] IEventAggregator eventAggregator,
            [param: Required] object commonSettings,
            [param: Required] object commonDatas,
            [param: Required] string mainViewName,
            [param: Required] string viewName
            )
        {
            // 拡張コンテナ、リージョンマネージャ、共通データの取得および設定をします。
            this.Container       = container ?? throw new ArgumentNullException(MethodBase.GetCurrentMethod().Name + Utility.ConstUtili.ERR_SEPA + nameof(container));
            this.RegionManager   = regionManager ?? throw new ArgumentNullException(MethodBase.GetCurrentMethod().Name + Utility.ConstUtili.ERR_SEPA + nameof(regionManager));
            this.EventAggregator = eventAggregator ?? throw new ArgumentNullException(MethodBase.GetCurrentMethod().Name + Utility.ConstUtili.ERR_SEPA + nameof(eventAggregator));
            this.MainViewName    = mainViewName ?? throw new ArgumentNullException(MethodBase.GetCurrentMethod().Name + Utility.ConstUtili.ERR_SEPA + nameof(mainViewName));
            this.ViewName        = viewName ?? throw new ArgumentNullException(MethodBase.GetCurrentMethod().Name + Utility.ConstUtili.ERR_SEPA + nameof(viewName));
            // objectからCommonSettingsにキャストして設定します。
            var cs = commonSettings ?? throw new ArgumentNullException(MethodBase.GetCurrentMethod().Name + Utility.ConstUtili.ERR_SEPA + nameof(commonSettings));

            this.CommonSettings = cs as Common.CommonSettings;
            // objectからCommonDatasにキャストして設定します。
            var cd = commonDatas ?? throw new ArgumentNullException(MethodBase.GetCurrentMethod().Name + Utility.ConstUtili.ERR_SEPA + nameof(commonDatas));

            this.CommonDatas = cd as Common.CommonDatas;

            // メッセージマネージャを設定します。
            this.MessageManager = new MessageManager(
                eventAggregator: eventAggregator,
                receivedMessage: this.ReceivedMessage,
                mainViewName: this.MainViewName,
                viewName: this.ViewName
                );
        }
Esempio n. 22
0
 /// <summary>
 /// Initializes a new instance of the <see cref="WeekViewModel"/> class.
 /// </summary>
 /// <param name="dialogService">Dialog service dependency.</param>
 /// <param name="regionManager">Region manager for Prism navigation.</param>
 /// <param name="container">IoC container.</param>
 /// <param name="dayService"><see cref="DayService"/> dependency.</param>
 /// <param name="mapper">Mapper dependency.</param>
 /// <param name="localization">Localization provider dependency.</param>
 /// <param name="options">Gets current application's settings.</param>
 public WeekViewModel(DialogService dialogService,
                      IRegionManager regionManager,
                      IContainerExtension container,
                      DayService dayService,
                      IMapper mapper,
                      ILocalization localization,
                      AppSettings options)
 {
     this.dialogService        = dialogService;
     this.regionManager        = regionManager;
     this.container            = container;
     this.dayService           = dayService;
     this.mapper               = mapper;
     this.localization         = localization;
     this.options              = options;
     CreateNewWeekCommand      = new DelegateCommand(CreateNewWeek);
     CreateShoppingListCommand = new DelegateCommand(CreateShoppingList);
     DeleteCommand             = new AsyncDelegateCommand(DeleteCurrentWeekAsync);
     DeleteDinnerCommand       = new AsyncDelegateCommand <Guid?>(DeleteDayAsync, canExecute: CanDeleteDay);
     LoadedCommand             = new AsyncDelegateCommand(OnLoadedAsync, executeOnce: true);
     MoveRecipeCommand         = new AsyncDelegateCommand <Guid>(MoveRecipeAsync);
     SelectDinnerCommand       = new AsyncDelegateCommand <DayOfWeek>(SelectDinnerAsync);
     SelectNextWeekCommand     = new AsyncDelegateCommand(SelectNextWeekAsync);
     SelectPreviousWeekCommand = new AsyncDelegateCommand(SelectPreviousWeekAsync);
     ShowRecipeCommand         = new DelegateCommand <Guid>(ShowRecipe);
 }
Esempio n. 23
0
        //Login loginView;

        public MainView(IContainerExtension container, IRegionManager regionManager)
        {
            InitializeComponent();
            _container     = container;
            _regionManager = regionManager;
            this.Loaded   += MainView_Loaded;
        }
Esempio n. 24
0
 public RecentViewSettings(IContainerExtension container)
 {
     recentMenu = new MenuItemViewModel("Recentl_y opened..", 100);
     menuGuids  = new List <String>();
     recentOpen = new DelegateCommand <String>(ExecuteMethod);
     _container = container;
 }
Esempio n. 25
0
    /// <summary>
    /// Initializes a new instance of the <see cref="RecipeListViewModel"/> class.
    /// </summary>
    /// <param name="dialogService">Dialog service dependency.</param>
    /// <param name="recipeFiltrator">RecipeFiltrator dependency.</param>
    /// <param name="container">IoC container.</param>
    /// <param name="regionManager">Region manager for Prism navigation.</param>
    /// <param name="recipeService">Recipe service dependency.</param>
    /// <param name="eventAggregator">Dependency on Prism event aggregator.</param>
    /// <param name="mapper">Mapper dependency.</param>
    /// <param name="localization">Localization provider dependency.</param>
    public RecipeListViewModel(DialogService dialogService,
                               RecipeFiltrator recipeFiltrator,
                               IContainerExtension container,
                               IRegionManager regionManager,
                               RecipeService recipeService,
                               IEventAggregator eventAggregator,
                               IMapper mapper,
                               ILocalization localization)
    {
        this.dialogService   = dialogService;
        this.recipeFiltrator = recipeFiltrator;
        this.container       = container;
        this.regionManager   = regionManager;
        this.recipeService   = recipeService;
        this.mapper          = mapper;
        this.localization    = localization;

        // Subscribe to events
        eventAggregator.GetEvent <RecipeCreatedEvent>().Subscribe(OnRecipeCreated, ThreadOption.UIThread);
        eventAggregator.GetEvent <RecipeUpdatedEvent>().Subscribe(OnRecipeUpdated, ThreadOption.UIThread);
        eventAggregator.GetEvent <RecipeDeletedEvent>().Subscribe(OnRecipeDeleted, ThreadOption.UIThread);

        LoadedCommand = new AsyncDelegateCommand(OnLoaded, executeOnce: true);

        ViewRecipeCommand = new DelegateCommand <Guid>(ViewRecipe);
        AddRecipeCommand  = new DelegateCommand(AddRecipe);

        RecipiesSource = new CollectionViewSource();
        RecipiesSource.SortDescriptions.Add(new SortDescription()
        {
            PropertyName = nameof(RecipeListViewDto.Name)
        });
    }
 public LoginPageViewModel(IContainerExtension container)
 {
     containerExtension = container;
     WarrnChangeCommand = new DelegateCommand(() => Warrning = "Loging Here");
     LogingCommand      = new RelayParameterizedCommand(async(p) => await ProcessLoging(p));
     LoadBranchNames();
 }
Esempio n. 27
0
        /// <summary>
        /// Runs the initialization sequence to configure the Prism application.
        /// </summary>
        public virtual void Initialize()
        {
            ContainerLocator.SetContainerExtension(CreateContainerExtension);
            _containerExtension = ContainerLocator.Current;
            _moduleCatalog      = CreateModuleCatalog();
            RegisterRequiredTypes(_containerExtension);
            RegisterTypes(_containerExtension);
            _containerExtension.FinalizeExtension();

            ConfigureModuleCatalog(_moduleCatalog);

            var regionAdapterMappins = _containerExtension.Resolve <RegionAdapterMappings>();

            ConfigureRegionAdapterMappings(regionAdapterMappins);

            var defaultRegionBehaviors = _containerExtension.Resolve <IRegionBehaviorFactory>();

            ConfigureDefaultRegionBehaviors(defaultRegionBehaviors);

            RegisterFrameworkExceptionTypes();

            var shell = CreateShell();

            if (shell != null)
            {
                _containerExtension.Resolve <IRegionNavigationService>().NavigationFailed += (s, e) => Console.WriteLine($"Region navigation failed {e.Error}");
                RegionManager.SetRegionManager(shell, _containerExtension.Resolve <IRegionManager>());
                RegionManager.UpdateRegions();
                InitializeShell(shell);
            }

            InitializeModules();
        }
Esempio n. 28
0
        protected virtual void SetUp()
        {
            /* ==================================================================================================
             * setting up auto mapper
             * ================================================================================================*/
            AutoMapperSettup();

            /* ==================================================================================================
             * Init container (use Autofac)
             * ================================================================================================*/
            _containerExtension = new AutofacContainerExtension(new ContainerBuilder());

            /* ==================================================================================================
             * Registers the required types of prism.
             * ================================================================================================*/
            RegisterRequiredTypes(_containerExtension);

            /* ==================================================================================================
             * Register for our types which defined in Core project
             * ================================================================================================*/
            DependencyRegistrar.Current.Init(_containerExtension);

            /* ==================================================================================================
             * finish setting
             * ================================================================================================*/
            _containerExtension.FinalizeExtension();
        }
        public ZoomableImage(IContainerExtension container, ImageViewParameter parameter)
        {
            // VMに引数を渡したいので自前でインスタンス作る
            DataContext = new ZoomableImageViewModel(container, parameter);

            InitializeComponent();
        }
Esempio n. 30
0
        public MDWorkspace(IContainerExtension container) : base(container)
        {
            IEventAggregator aggregator = Container.Resolve <IEventAggregator>();

            aggregator.GetEvent <ActiveContentChangedEvent>().Subscribe(ContentChanged);
            _document = "";
        }
Esempio n. 31
0
        public void AddExtension(IContainerExtension containerExtension)
        {
            using (this.readerWriterLock.AcquireWriteLock())
            {
                var postBuildExtension = containerExtension as IPostBuildExtension;
                if (postBuildExtension != null)
                {
                    this.postbuildExtensions.Add(postBuildExtension);
                    this.hasPostBuildExtensions = true;
                }

                var registrationExtension = containerExtension as IRegistrationExtension;
                if (registrationExtension == null) return;
                this.registrationExtensions.Add(registrationExtension);
                this.hasRegistrationExtensions = true;
            }
        }
        /// <summary>
        ///     The register.
        /// </summary>
        /// <param name="extension">
        ///     The extension.
        /// </param>
        /// <exception cref="NotImplementedException">
        /// </exception>
        public void Register(IContainerExtension extension)
        {
            Contract.Requires<ArgumentNullException>(extension != null, "extension");

            throw new NotImplementedException();
        }
 /// <summary>
 ///     The register.
 /// </summary>
 /// <param name="extension">
 ///     The extension.
 /// </param>
 public void Register(IContainerExtension extension)
 {
     extension.Initialize(_componetnts);
     _extensions.Add(extension);
 }