/// <summary>
        /// Initializes a new instance of the <see cref="BlazorAssetWindow"/> class.
        /// </summary>
        public BlazorAssetWindow(AssetWindowState state) : base()
        {
            //IVsSolution solService = this.GetService(typeof(SVsSolution)) as IVsSolution;
            //_state = new AssetWindowState { Solution = solService };
            this._state  = state;
            this.Caption = "Blazor JS & CSS Assets";

            // This is the user control hosted by the tool window; Note that, even if this class implements IDisposable,
            // we are not calling Dispose on this object. This is because ToolWindowPane calls Dispose on
            // the object returned by the Content property.
            var assetControl = new BlazorAssetWindowControl(_state);

            this.Content = assetControl;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlazorAssetWindowControl"/> class.
        /// </summary>
        public BlazorAssetWindowControl(AssetWindowState state)
        {
            _state = state;
            //ViewModel = new BlazorAssetsViewModel(state);
            this.InitializeComponent();

            this.WhenActivated(d =>
            {
                this.ViewModel = (MainViewModel)Splat.Locator.Current.GetService(typeof(MainViewModel));
                this.ViewModel.Initialize(_state);

                this.OneWayBind(this.ViewModel, x => x.Projects, x => x.projectBox.ItemsSource).DisposeWith(d);
                this.Bind(this.ViewModel, x => x.SelectedProject, x => x.projectBox.SelectedItem).DisposeWith(d);
                this.OneWayBind(this.ViewModel, x => x.SelectedProject, x => x.selectedProjectView.ViewModel).DisposeWith(d);
            });
        }